• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem while printing international characters using system.out.print  RSS feed

 
Pushker Chaubey
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am reading a txt file which contains latin + japanese characters.
I am using inputstreamreader (with encoding mentioned as utf-8) to read the content into a string. Then I printing the string using System.out.println(String). But i only see something like ??? as output.

I think my program only displays those charcters properly which as per system's default encoding.

How can I fix this?
 
Usha Seetharaman
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For printing the characters in console using system.out.println, you need to use a different encoding like "cp850", but is your requirement to print in the console or on the browser.
[ May 12, 2008: Message edited by: Usha Seetharaman ]
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consoles can't generally display anything but US-ASCII, so that's not by itself indicative of a problem.

If you use UTF-8 as the encoding during reading, are you certain that the input file actually is in UTF-8?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!