FAQ
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.

Search Discussions

  • Siano, Stephan at Oct 9, 2015 at 8:26 am
    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
    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.
  • Creekmind at Nov 6, 2015 at 9:45 am
    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupusers @
categoriescamel
postedOct 8, '15 at 7:35a
activeNov 6, '15 at 9:45a
posts3
users2
websitecamel.apache.org

2 users in discussion

Creekmind: 2 posts Siano, Stephan: 1 post

People

Translate

site design / logo © 2021 Grokbase