Read special symbols from file

后端 未结 2 1391
刺人心
刺人心 2020-12-12 07:47

I am trying to read file using Java and the file also containing special characters also. I am trying to write the contents of file into another file.

What is the so

2条回答
  •  粉色の甜心
    2020-12-12 08:38

    Encode file in UTF-8 and use java encoding aware streams operators:

    new InputStreamReader(new FileInputStream(file), "UTF-8")
    

提交回复
热议问题