Converting UTF-8 to ISO-8859-1 in Java - how to keep it as single byte

Posted by luckylak on Stack Overflow See other posts from Stack Overflow or by luckylak
Published on 2009-03-17T20:25:06Z Indexed on 2010/03/30 9:03 UTC
Read the original article Hit count: 570

Filed under:
|
|

Hi, I am trying to convert a string encoded in java in UTF-8 to ISO-8859-1. Say for example, in the string 'âabcd' 'â' is represented in ISO-8859-1 as E2. In UTF-8 it is represented as two bytes. C3 A2 I believe. When I do a getbytes(encoding) and then create a new string with the bytes in ISO-8859-1 encoding, I get a two different chars. â. Is there any other way to do this so as to keep the character the same i.e. âabcd?

© Stack Overflow or respective owner

Related posts about utf-8

Related posts about iso-8859-1