-1

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 solution to read special character files?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Adesh singh
  • 2,083
  • 9
  • 24
  • 36

1 Answers1

3

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

new InputStreamReader(new FileInputStream(file), "UTF-8")
Aleksander Gralak
  • 1,509
  • 10
  • 26