Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert String from UTF-8 to IsoLatin1

807601Feb 23 2008 — edited Feb 23 2008
Hi everyone !

I'm trying to convert a String from utf-8 to IsoLatin1, but i got somt problems.... I'm using
actually this code, but it won't work...

I'm getting a utf-8 html String with some data and i will write it down in latin1 to a text file
String newString = new String(oldString.getBytes("UTF-8"), "ISO-8859-1");
If i'm now writing this newString to a TextFile it contains cryptic signs like
& # 1 3 ;
or
& # 1 3 7 ;
or
& # 1 2 8 ;
(i separated this chars)


can anyone tell me where is my fault and how can i solve this problem ?

Thanks a lot

Edited by: Sephiknight on Feb 23, 2008 2:41 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2008
Added on Feb 23 2008
5 comments
723 views