camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Email character encoding?
Date Thu, 24 Jun 2010 13:41:45 GMT
On Thu, Jun 24, 2010 at 3:37 PM, Willem Jiang <willem.jiang@gmail.com> wrote:
> Claus Ibsen wrote:
>>
>> On Thu, Jun 24, 2010 at 2:52 PM, Willem Jiang <willem.jiang@gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I just check the Java document of MimeMessage[1], the message subject
>>> *must*
>>> contain only US-ASCII characters, maybe that cause your problem.
>>>
>>>
>>> [1]http://java.sun.com/products/javamail/javadocs/javax/mail/internet/MimeMessage.html
>>>
>>
>> Ah there is an overloaded setSubject which accepts a charset. Do we
>> use that in the camel-mail code?
>>
>
> Yes, we used it in camel 2.3, but I think there could be something wrong
> with getting the default charset from the exchange.
>

Ah yeah you change some code to fallback to use UTF-8 or JVM default
or something.
This may cause that issue?


>>
>>> Willem Jiang wrote:
>>>>
>>>> Mattias Severson wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> I am having trouble sending ISO-8859-1 characters, e.g. едц, in emails.
>>>>> I
>>>>> have tried to set the defaultEncoding option of the
>>>>> http://camel.apache.org/mail.html Camel Mail  component to ISO-8859-1,
>>>>> but
>>>>> that did not solve the problem.
>>>>> The sender is implemented as
>>>>>
>>>>> producerTemplate.sendBodyAndHeaders(emailRecipientUri, emailBody,
>>>>> camelEmailHeaders);
>>>>
>>>> Maybe you need to set the Exchange.property for the charset like this
>>>>
>>>> producerTemplate.send(emailRecipientUri, new Processor() {
>>>>  void process(Exchange exchange) throws Exception {
>>>>      exchange.getIn().setBody(emailBody);
>>>>      exchange.getIn().setHeaders(camelEmailHeaders);
>>>>      exchange.setProperty(Exchange.CHARSET_NAME, "ISO-8859-1");
>>>>  }
>>>> }
>>>>
>>>> Willem
>>>> ----------------------------------
>>>> Apache Camel, Apache CXF committer
>>>> Open SOA http://www.fusesource.com
>>>> Blog http://willemjiang.blogspot.com
>>>> Tiwtter http://twitter.com/willemjiang
>>>>>
>>>>> and I am using Camel 2.3.0
>>>>>
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> /Mattias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
>>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message