Pavel !
 
Thanks for you help.
 
To your question about the final result ...
At the end I would like to be able entering any! string into XML file and then transform it into anything with XSL. Is it possible that the resulting XML file will be in utf-8 encoding or should I check the encoding of each message and then create xml file with the original encoding  (as Joseph Kesselman proposed - thanks by the way :-) )?

Pavel Ausianik wrote:
>

Hi,

 

In fact you code fragmentcould not change anything.

 

If the String messageTextis ok, after transformation you should get String equal to original one. Ingeneral, while you have valid Java Strings in memory everything is fine, andproblems occur when you are trying to convert it to an binary format for ex. saveto the file.

 

The open question whatwould you like to get at the end of the process.

 

If your String is an XMLstring and you’d like to save it to file in UTF-8 encoding, you couldsave a convertArray instead.

 

Best regards,

Pavel

 

 

-----OriginalMessage-----
From: Dima Gutzeit [mailto:[EMAIL PROTECTED]
Sent:
Tuesday, December 03, 2002 2:27 AM
To: [EMAIL PROTECTED]
Subject: Encoding issues

Hi !

 

I am trying to create mail application that willhandle e-mails in many languages. All the data flow inside the application ismade with XML.

There are some e-mails though that create problemssuch as "Invalid UTF 8 character ....".

 

I thought that using the following code to convertanything to UTF will solve it :

 

          byte[] convertArray;
           convertArray= messageText.getBytes("utf-8");
           messageText =new String(convertArray, "utf-8");

 

The "messageText" variable is being insertedto XML file with this declaration. 

 <?xml version="1.0"encoding="utf-8"?>

 

To my surprise this approach fails. There are stillsome messages that report that "invalid utf sequence" error.

 

Does anyone has any idea how can make it work forany!!! message?

 

Thanks in advance.

 

Regards ,
Dima Gutzeit
.
---------------------------------
MailVision LTD.
R&D Team.
Phone: 972 - 4 - 8508020
Fax: 972 - 3 - 9285149
http://www.mailvision.com


--------------------------------------------------------------------- Tounsubscribe, e-mail: [EMAIL PROTECTED] For additionalcommands, e-mail: [EMAIL PROTECTED]


Regards ,
Dima Gutzeit
.
---------------------------------
MailVision LTD.
R&D Team.
Phone: 972 - 4 - 8508020
Fax: 972 - 3 - 9285149
http://www.mailvision.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to