0

I'm sending through a form, some text inside a TEXTAREA and a INPUT with type="text".

In those boxes, when I write, for example "è", my destination Servlet receive "è".

I've tried adding System.setProperty("file.encoding", "UTF-8"); but it's not working.

How can I solve this?

abierto
  • 1,447
  • 7
  • 29
  • 57

2 Answers2

0

Your encoding on the server side is Latin1/ISO-8859-1/ISO-8859-15 you have to change that.

You can do this by adding the following parameter to the java call.

java -Dfile.encoding=UTF-8

(see: Setting the default Java character encoding? )

For Webservers (like tomcat) you will have to change that in the starting script.

Preferably you change the encoding on the whole machine to UTF-8 if possible, so you wont get problems with files being Latin1

Community
  • 1
  • 1
Angelo Fuchs
  • 9,825
  • 1
  • 35
  • 72
0

Depending on your server configuration you may find that it is expecting or working in "ISO-8859-1".

You need to make sure that both client and server are using the same encoding.

Tim B
  • 40,716
  • 16
  • 83
  • 128