Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

character encodings in streamReaders/Writers  RSS feed

 
Jeff Gaer
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a little confused ( suprise)
This is how I think it works,
Internally Java uses Unicode Character sets
WHen outputting to/inputting from it uses whatever UTF encoding is set in either the OS, system property, or the contstrutor, by default this is UTF-8 which corresponds closely to ascii and
ISO 8859-1. SO the 8859 is a unicode specification and utf-8 is a utf encoding that just happens to represent all chars as a btye.
So all internal strings are Unicode. ( are they always 8859, if not how is that controlled and is it associated with the string or only a function of the conversion when reading from a byte stream) Output streams are always some UTF encoding.
Please correct all my mistakes, this stuff is making me crazy.

 
Jeff Gaer
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, just realized I got it backwards.
UTF is what is used internally ( is it always utf-8??? what if the encoding is CHineese???
So is it ALWAYS unicode that is written to the file?
Is ISO 8859 a utf encoding or an unicode encoding.

More importantly is there a synopsis of this on the web that has some detail?? I obviously don't get it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!