Created a web application on servlets with the tomcat server and ran into an encoding problem.

French characters are output to the console and written to a file in this form.

Rue AndrГ © CitroГ «n

I have defined the JAVA_OPTS variable in the setenv.bat file as

set "JAVA_OPTS=%JAVA_OPTS% -Dfile.encoding=UTF8" 

Charset.defaultCharset () displays "UTF-8"
At the same time, I write everything perfectly in the MySQL database without kryakozyabry.

  • You obviously have a problem with the console coding, that is, in what encoding the console itself works - Barmaley
  • do you have windows os - Mikhail Vaysman
  • @MikhailVaysman yes, Windows 7 - Theillko OSG
  • The problem is in the encoding of the file itself with the .csv extension, in .txt everything is displayed normally - Theillko OSG
  • the console in windows uses a different encoding and not all characters in it are available. - Mikhail Vaysman

0