Some special characters defined in "ISO-8859-1" can't be shown when encoding with "UTF-8"
Posted
by Mike.Huang
on Stack Overflow
See other posts from Stack Overflow
or by Mike.Huang
Published on 2010-03-13T16:05:50Z
Indexed on
2010/03/13
16:25 UTC
Read the original article
Hit count: 371
I need to get a string from URL request of brower, and then create a text image by requested text. I know the default encoding of the Java net transmission is "ISO-8859-1", it can works normally with all characters what defined in "ISO-8859-1". But when I request a multi-byte Unicode character (e.g. chinese or something like ¤?
), then I need to decode it by "UTF-8" from "ISO-8859-1".
My codes like:
String reslut = new String(requestString.getBytes("ISO-8859-1"), "UTF-8");
Everything is fine, but I found some characters in ISO-8859-1 are not been shown now, which characters are 0x80 - 0xFF(defined in" ISO-8859-1"), i.e. the characters after 0x80 (in "ISO-8859-1") not been shown when converted to "UTF-8" from "ISO-8859-1".
Any other method can solve this query?
© Stack Overflow or respective owner