You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by creekmind <cr...@gmail.com> on 2015/10/08 09:34:50 UTC
Attachment filename encoding issue
Hello,
I use SMTP component and I have problem with cyrillic filename for
attachment.
The issue is like https://issues.apache.org/jira/browse/CAMEL-4007, but I
have cyrillic characters, not german Umlaut characters at the attachment
file name. According to it, I changed filename to
"\u041f\u0440\u0438\u0432\u0435\u0442", but still name is wrong, something
like this - "@825B". I used the test attached to JIRA thread and with german
umlaut character everything is fine, by cyrillic not working.
I thought I need to change Content-Disposition header, but I didn't get how
to reach it from DataHandler.
...
Message in = exchange.getIn();
data = Base64.decodeBase64(data);
in.addAttachment("\u041f\u0440\u0438\u0432\u0435\u0442", new
DataHandler(data, "application/vnd.ms-excel"));
...
--
View this message in context: http://camel.465427.n5.nabble.com/Attachment-filename-encoding-issue-tp5772410.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: Attachment filename encoding issue
Posted by creekmind <cr...@gmail.com>.
Hello,
A lot of time has passed, but at last I tried your solution. Yes, it works,
thank you!
--
View this message in context: http://camel.465427.n5.nabble.com/Attachment-filename-encoding-issue-tp5772410p5773429.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: Attachment filename encoding issue
Posted by "Siano, Stephan" <st...@sap.com>.
Hi,
Non-ASCII characters with MIME headers is always a bit difficult. You could try to use
in.addAttachment(javax.mail.internet.MimeUtility.encodeText("\u041f\u0440\u0438\u0432\u0435\u0442", "UTF-8", null), new
DataHandler(data, "application/vnd.ms-excel"));
This may or may not work with your mail client in the end...
Best regards
Stephan
-----Original Message-----
From: creekmind [mailto:creekmind@gmail.com]
Sent: Donnerstag, 8. Oktober 2015 09:35
To: users@camel.apache.org
Subject: Attachment filename encoding issue
Hello,
I use SMTP component and I have problem with cyrillic filename for
attachment.
The issue is like https://issues.apache.org/jira/browse/CAMEL-4007, but I
have cyrillic characters, not german Umlaut characters at the attachment
file name. According to it, I changed filename to
"\u041f\u0440\u0438\u0432\u0435\u0442", but still name is wrong, something
like this - "@825B". I used the test attached to JIRA thread and with german
umlaut character everything is fine, by cyrillic not working.
I thought I need to change Content-Disposition header, but I didn't get how
to reach it from DataHandler.
...
Message in = exchange.getIn();
data = Base64.decodeBase64(data);
in.addAttachment("\u041f\u0440\u0438\u0432\u0435\u0442", new
DataHandler(data, "application/vnd.ms-excel"));
...
--
View this message in context: http://camel.465427.n5.nabble.com/Attachment-filename-encoding-issue-tp5772410.html
Sent from the Camel - Users mailing list archive at Nabble.com.