How to encode special characters for POST using Spring / Roo

I use Spring / Roo for the application server and should be able to send some special characters. In particular, symbols such as the yen symbol, or the euro symbol. When I receive these characters on my server and display them on the console, they are displayed as "?". How can they be correctly encoded and received?

+3
source share
2 answers

There are a couple of possible points of failure.

First I checked if the console supports the corresponding characters:

  • , JVM, , System.out
  • ,
  • , System.out,

, , int - Unicode charts.

. UTF-8 . , , , ; , GET ( ). Accept-Charset header, ( Firebug Fiddler). Roo, - .

+3

src/main/resources/META-INF/spring/database.properties :

database.url=jdbc:mysql://[YOUR_DB_SERVER]:3306/[YOUR_DB_NAME]?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
+6

Source: https://habr.com/ru/post/1740484/


All Articles