Thursday, January 24, 2008

Java: reading / writing international characters

It is actually very easy to support international characters in java. The only trick is knowing the charset that the text is encoded in. Most of the time is a safe bet to try UTF-8 if you dont know. If you use Apache's HTTPClient it has methods to get the charset of the stream you are reading from.


3 comments:

  1. Thanks! This code was just what I needed in order to read and write æ, ø & å! :-)

    ReplyDelete
  2. Hi!

    How can I read international characters from console?

    Thanks, Tibor

    ReplyDelete
  3. @Tibor: stackoverflow is where you should be asking questions like this, not a random blog.

    Ive gone ahead and asked your question there:
    http://stackoverflow.com/questions/2507789/how-can-i-read-international-characters-from-console

    ReplyDelete