How can I open files containing accents in Java?

前端 未结 6 1624
傲寒
傲寒 2020-12-01 18:44

(editing for clarification and adding some code)

Hello, We have a requirement to parse data sent from users all over the world. Our Linux systems have a de

6条回答
  •  遥遥无期
    2020-12-01 19:15

    The Java system property file.encoding should match the console's character encoding. The property must be set when starting java on the command-line:

    java -Dfile.encoding=UTF-8 …
    

    Normally this happens automatically, because the console encoding is usually the platform default encoding, and Java will use the platform default encoding if you don't specify one explicitly.

提交回复
热议问题