|
Hi,
In fact you code fragment could not change anything.
If the String messageText is ok, after transformation you should get String equal to original one. In general, while you have valid Java Strings in memory everything is fine, and problems occur when you are trying to convert it to an binary format for ex. save to the file.
The open question what would you like to get at the end of the process.
If your String is an XML string and you’d like to save it to file in UTF-8 encoding, you could save a convertArray instead.
Best regards, Pavel
-----Original
Message-----
Hi !
I am trying to create mail application that will handle e-mails in many languages. All the data flow inside the application is made with XML. There are some e-mails though that create problems such as "Invalid UTF 8 character ....".
I thought that using the following code to convert anything to UTF will solve it :
byte[] convertArray;
The "messageText" variable is being inserted to XML file with this declaration. <?xml version="1.0" encoding="utf-8"?>
To my surprise this approach fails. There are still some messages that report that "invalid utf sequence" error.
Does anyone has any idea how can make it work for any!!! message?
Thanks in advance.
Regards ,
|
- Encoding issues Dima Gutzeit
- Re: Encoding issues Joseph Kesselman
- Re: RE: Encoding issues Pavel Ausianik
- Re: RE: Encoding issues Dima Gutzeit
- RE: RE: Encoding issues Pavel Ausianik
- RE: RE: Encoding issues Pavel Ausianik
