This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

about the read() in the FileReader class...  RSS feed

 
Jian Zhang
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I open a file using FileReader, then use the read() method to read the file in to a char array, but in the xp of English version it will read some unknown characters like small cubes,(hell knows what is that!),but in Chinese version of xp , it reads pretty ok. Gonna confused to death!
somebody kind who is willing to help me?thanks a lot!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
floatingkent Zhang,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would guess that the character array contains characters that the font in use by the english machine cannot display. If you want the characters to be displayed on the english machine, you'll likely have to specify that the appropriate font be used.
 
Jian Zhang
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for your help,but could you tell me how to change the font in the character array?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There isn't a font in the character array to be changed. A font to be used can be specified when text is displayed on certain components.
I'm moving this to the Swing / JFC / AWT forum where they like to talk about this fancy display stuff.
Also, floatingkent is not an improvement over your original display name. Again, please change your display name to comply with The JavaRanch Naming Policy. We'd like to a first name, a space, and a last name. Note that "floating kent" won't qualify as it's obviously fictitious.
It may seem obnoxious that we're asking you to change your display name to conform with one of our few policies (another being "be nice"), but what this community has to offer in terms of learning assistence makes this small request worth the effort of fulfilling.
Thanks Pardner! Hope to see you 'round the Ranch!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!