Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

Unsupported Encoding

Thread view: 
none - 27 May 2006 00:16 GMT
I'm in the process of writing a mail client using javamail, but have
come across some text encoding problems. When a message has content of
the iso-8859-10, iso-8859-14 and iso-8859-16 types i get an
'UnsupportedEncodingException' when trying to retrieve the message
content. Below is an example stack trace.

java.io.UnsupportedEncodingException: iso-8859-10
   at sun.io.Converters.getConverterClass(Converters.java:218)
   at sun.io.Converters.newConverter(Converters.java:251)
   at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java:68)
   at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:224)
   at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java:210)
   at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:77)
   at java.io.InputStreamReader.<init>(InputStreamReader.java:83)
   at com.sun.mail.handlers.text_plain.getContent(text_plain.java:64)
   at
javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:745)
   at javax.activation.DataHandler.getContent(DataHandler.java:501)
   at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1332)
   at com.devisland.webmail.MailLayer.hasAttachment(MailLayer.java:145)

What the best way to add support for these encodings? i'm not familar
with the sun.io.converters package. Any help would be great.

Thanks in advance,

Tim
Chris Smith - 27 May 2006 03:55 GMT
> I'm in the process of writing a mail client using javamail, but have
> come across some text encoding problems. When a message has content of
> the iso-8859-10, iso-8859-14 and iso-8859-16 types i get an
> 'UnsupportedEncodingException' when trying to retrieve the message
> content. Below is an example stack trace.

> What the best way to add support for these encodings? i'm not familar
> with the sun.io.converters package. Any help would be great.

I don't know, actually.  However, the stack trace mentions NIO.  You
might try starting with java.nio.charset.spi.CharsetProvider.  I am not
sure it'll work, so you might try creating a toy charset first, before
you start with all the rote work of transcribing those ISO standards
into Java.

Signature

www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation

Dale King - 30 May 2006 05:32 GMT
> I'm in the process of writing a mail client using javamail, but have
> come across some text encoding problems. When a message has content of
[quoted text clipped - 3 lines]
>
> java.io.UnsupportedEncodingException: iso-8859-10

According to the list of supported encodings none of those three are
supported:

http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html

> What the best way to add support for these encodings? i'm not familar
> with the sun.io.converters package. Any help would be great.

You should be looking in java.nio.charset and in addition you will need
to look at java.nio.charset.spi since you will have to create a service
provider. If you only care about decoding then your job will be pretty
simple.

Signature

 Dale King



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.