How can I open files containing accents in Java?

前端 未结 6 1631
傲寒
傲寒 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:21

    It's a bug in the old-skool java File api, maybe just on a mac? Anyway, the new java.nio api works much better. I have several files containing unicode characters that failed to load using java.io... classes. After converting all my code to use java.nio.Path EVERYTHING started working. And I replaced apache FileUtils (which has the same problem) with java.nio.Files...

提交回复
热议问题