How do I (1) detect and (2) correct a java.io.CharConversionException error when reading an email message?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Steven_Branker
Posted On:   Wednesday, January 9, 2002 08:29 AM

The following is in the body of an email message that causes a CharConversionException error. I believe it's the (R) in the following line.


----------- BEGIN EMAIL BODY ---------

Thank you for requesting your UPS OnLineĀ® Tools Developer


java.io.CharConversionException: Not an ISO 8859-1 character:

Re: How do I (1) detect and (2) correct a java.io.CharConversionException error when reading an email message?

Posted By:   Steven_Branker  
Posted On:   Thursday, January 10, 2002 09:20 PM

I ended up doing the following:



byte[] byte_string = s.getBytes();
try{
String unicodeString = new String(byte_string, "ASCII");
out.print(unicodeString);
}catch(UnsupportedEncodingException ex)
{
out.print(". Sorry. The rest of the message contained unsupported text.");
}

About | Sitemap | Contact