Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading Japanese Characters from Text File

Souvik Das
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a text file where the text is written in Japanese. While I want to read the file using Java it can not recognise the japanese characters and it is giving "???" like characters instead of Japanese characters.

FileInputStream fis = new FileInputStream("out.txt");
InputStreamReader isr = new InputStreamReader(fis,"UTF-8");

Reader in = new BufferedReader(isr);

StringBuffer buf = new StringBuffer();
int ch;
while ((ch = > -1) {

String message = new String(buf.toString()); // Here i want the japanese characters to appear

I have also tried "Shift_Jis" encoding isnstead of "UTF-8" encoding also.

Thanks in advance.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic