You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by haipeng du <ha...@gmail.com> on 2006/04/18 17:31:48 UTC

encoding error

When I read mail content, I got error of
java.io.UnsupportedEncodingException: unknown-8bit
        at sun.io.Converters.getConverterClass(Converters.java:215)
        at sun.io.Converters.newConverter(Converters.java:248)
        at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java
:64)
        at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java
:223)
        at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java
:209)
        at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java
:76)
        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:1339)
        at org.apache.james.core.MimeMessageWrapper.getContent(
MimeMessageWrapper.java:647)
        at com.comphealth.job.processors.ForwardProcessor.extractMailContent
(ForwardProcessor.java:303)
        at
com.comphealth.job.processors.ForwardProcessor.getForwardRecipients(
ForwardProcessor.java:383)
        at com.comphealth.job.processors.ForwardProcessor.processMail(
ForwardProcessor.java:255)
        at com.comphealth.job.processors.AbstractMailProcessor.process(
AbstractMailProcessor.java:32)
        at com.comphealth.job.mailet.JobMailProcessMailet.service(
JobMailProcessMailet.java:48)
        at org.apache.james.transport.LinearProcessor.service(
LinearProcessor.java:407)
        at org.apache.james.transport.JamesSpoolManager.process(
JamesSpoolManager.java:451)
        at org.apache.james.transport.JamesSpoolManager.run(
JamesSpoolManager.java:360)
        at java.lang.Thread.run(Thread.java:534)

How could I configure james to support this encoding?
Thanks a lot.

--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City

Re: encoding error

Posted by Stefano Bagnara <ap...@bago.org>.
haipeng du wrote:
> But from a mail client, that message is shown correctly. So is that possible
> I can resolve this from programming?

If this happens then there are no bytes greater than 127 or your sending 
agent and receiving agent have the same default charset and simply apply 
a default charset when an unknown charset is found.

You can catch that exception, replace the charset with a different 
charset and retry the operation you where processing.

Stefano

> On 4/18/06, Stefano Bagnara <ap...@bago.org> wrote:
>> haipeng du wrote:
>>> Yes, I got one email outside and I try to read the content in mailet.
>>> the part of header is:
>>>
>>> MIME-Version: 1.0
>>> X-MIME-Autoconverted: from 8bit to quoted-printable by
>>> smtp.comphealth.com id k3I4FhUE010552
>>> Content-Transfer-Encoding: quoted-printable
>>> Content-Type: text/plain; charset=unknown-8bit
>>>
>>> Because "unknown-8bit" is not supported. How could I configure james
>>> so that I can read the content that has some error?
>>> Thanks a lot.
>> unknown-8bit is not supported because it is an invalid charset. You
>> can't decode an "unknown-8bit" source.
>>
>> Try asking in the JavaMail forum or better try to understand why you
>> receive messages with this unexisting charset (the sender has something
>> wrong).
>>
>> Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: encoding error

Posted by haipeng du <ha...@gmail.com>.
But from a mail client, that message is shown correctly. So is that possible
I can resolve this from programming?

On 4/18/06, Stefano Bagnara <ap...@bago.org> wrote:
>
> haipeng du wrote:
> > Yes, I got one email outside and I try to read the content in mailet.
> > the part of header is:
> >
> > MIME-Version: 1.0
> > X-MIME-Autoconverted: from 8bit to quoted-printable by
> > smtp.comphealth.com id k3I4FhUE010552
> > Content-Transfer-Encoding: quoted-printable
> > Content-Type: text/plain; charset=unknown-8bit
> >
> > Because "unknown-8bit" is not supported. How could I configure james
> > so that I can read the content that has some error?
> > Thanks a lot.
>
> unknown-8bit is not supported because it is an invalid charset. You
> can't decode an "unknown-8bit" source.
>
> Try asking in the JavaMail forum or better try to understand why you
> receive messages with this unexisting charset (the sender has something
> wrong).
>
> Stefano
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>


--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City

Re: encoding error

Posted by Stefano Bagnara <ap...@bago.org>.
haipeng du wrote:
> Yes, I got one email outside and I try to read the content in mailet.
> the part of header is:
> 
> MIME-Version: 1.0
> X-MIME-Autoconverted: from 8bit to quoted-printable by
> smtp.comphealth.com id k3I4FhUE010552
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/plain; charset=unknown-8bit
> 
> Because "unknown-8bit" is not supported. How could I configure james
> so that I can read the content that has some error?
> Thanks a lot.

unknown-8bit is not supported because it is an invalid charset. You 
can't decode an "unknown-8bit" source.

Try asking in the JavaMail forum or better try to understand why you 
receive messages with this unexisting charset (the sender has something 
wrong).

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Re: encoding error

Posted by haipeng du <ha...@gmail.com>.
Yes, I got one email outside and I try to read the content in mailet.
the part of header is:

MIME-Version: 1.0
X-MIME-Autoconverted: from 8bit to quoted-printable by
smtp.comphealth.com id k3I4FhUE010552
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=unknown-8bit

Because "unknown-8bit" is not supported. How could I configure james
so that I can read the content that has some error?
Thanks a lot.



On 4/18/06, Stefano Bagnara <ap...@bago.org> wrote:
>
> Maybe this is not a James issue.
> What does your com.comphealth.job.* classes do?
>
> ("8bit" is a valid encoding, "unknown-8bit" should never be written by
> James)
>
> Stefano
>
> haipeng du wrote:
> > When I read mail content, I got error of
> > java.io.UnsupportedEncodingException: unknown-8bit
> >         at sun.io.Converters.getConverterClass(Converters.java:215)
> >         at sun.io.Converters.newConverter(Converters.java:248)
> >         at sun.io.ByteToCharConverter.getConverter(
> ByteToCharConverter.java
> > :64)
> >         at sun.nio.cs.StreamDecoder$ConverterSD.<init>(
> StreamDecoder.java
> > :223)
> >         at sun.nio.cs.StreamDecoder$ConverterSD.<init>(
> StreamDecoder.java
> > :209)
> >         at sun.nio.cs.StreamDecoder.forInputStreamReader(
> StreamDecoder.java
> > :76)
> >         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
> :1339)
> >         at org.apache.james.core.MimeMessageWrapper.getContent(
> > MimeMessageWrapper.java:647)
> >         at
> com.comphealth.job.processors.ForwardProcessor.extractMailContent
> > (ForwardProcessor.java:303)
> >         at
> > com.comphealth.job.processors.ForwardProcessor.getForwardRecipients(
> > ForwardProcessor.java:383)
> >         at com.comphealth.job.processors.ForwardProcessor.processMail(
> > ForwardProcessor.java:255)
> >         at com.comphealth.job.processors.AbstractMailProcessor.process(
> > AbstractMailProcessor.java:32)
> >         at com.comphealth.job.mailet.JobMailProcessMailet.service(
> > JobMailProcessMailet.java:48)
> >         at org.apache.james.transport.LinearProcessor.service(
> > LinearProcessor.java:407)
> >         at org.apache.james.transport.JamesSpoolManager.process(
> > JamesSpoolManager.java:451)
> >         at org.apache.james.transport.JamesSpoolManager.run(
> > JamesSpoolManager.java:360)
> >         at java.lang.Thread.run(Thread.java:534)
> >
> > How could I configure james to support this encoding?
> > Thanks a lot.
> >
> > --
> > Haipeng Du
> > Software Engineer
> > Comphealth,
> > Salt Lake City
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
>


--
Haipeng Du
Software Engineer
Comphealth,
Salt Lake City

Re: encoding error

Posted by Stefano Bagnara <ap...@bago.org>.
Maybe this is not a James issue.
What does your com.comphealth.job.* classes do?

("8bit" is a valid encoding, "unknown-8bit" should never be written by 
James)

Stefano

haipeng du wrote:
> When I read mail content, I got error of
> java.io.UnsupportedEncodingException: unknown-8bit
>         at sun.io.Converters.getConverterClass(Converters.java:215)
>         at sun.io.Converters.newConverter(Converters.java:248)
>         at sun.io.ByteToCharConverter.getConverter(ByteToCharConverter.java
> :64)
>         at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java
> :223)
>         at sun.nio.cs.StreamDecoder$ConverterSD.<init>(StreamDecoder.java
> :209)
>         at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java
> :76)
>         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:1339)
>         at org.apache.james.core.MimeMessageWrapper.getContent(
> MimeMessageWrapper.java:647)
>         at com.comphealth.job.processors.ForwardProcessor.extractMailContent
> (ForwardProcessor.java:303)
>         at
> com.comphealth.job.processors.ForwardProcessor.getForwardRecipients(
> ForwardProcessor.java:383)
>         at com.comphealth.job.processors.ForwardProcessor.processMail(
> ForwardProcessor.java:255)
>         at com.comphealth.job.processors.AbstractMailProcessor.process(
> AbstractMailProcessor.java:32)
>         at com.comphealth.job.mailet.JobMailProcessMailet.service(
> JobMailProcessMailet.java:48)
>         at org.apache.james.transport.LinearProcessor.service(
> LinearProcessor.java:407)
>         at org.apache.james.transport.JamesSpoolManager.process(
> JamesSpoolManager.java:451)
>         at org.apache.james.transport.JamesSpoolManager.run(
> JamesSpoolManager.java:360)
>         at java.lang.Thread.run(Thread.java:534)
> 
> How could I configure james to support this encoding?
> Thanks a lot.
> 
> --
> Haipeng Du
> Software Engineer
> Comphealth,
> Salt Lake City
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org