james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Warski <a...@warski.org>
Subject Re: Decoding an attachment filename sent from Mail.app using DecoderUtil.decodeEncodedWords
Date Wed, 20 Apr 2011 14:20:24 GMT

> Does this means also that when Mail.app receives a mime with the name
> =?utf-8?Q?Z=CC=87o=CC=81=C5=82w=2Ertf?= it correctly saves the
> attchment as "Żółw.rtf" ?? It would be weird as I'm not aware (but I'm
> not an unicode guru, and that's why I ask you for this test) of utf-8
> decoding where an UTF8 sequence alter the previous Ascii character and
> the Z is wrote in clear ascii in that encoded string.

Yes, when such a mail is received Mail.app and other mail clients (gmail, thunderbird, outlook)
properly decode the file name.

>> Is there some way to properly decode the filename?
> 
> You can try using java.text.Normalizer. Let us now if this works.

Wow thanks! I added:
Normalizer.normalize(decodedString, Normalizer.Form.NFC);

After calling DecoderUtil and I get the proper filename.

Thanks again! :)

-- 
Adam Warski
http://www.warski.org
http://www.softwaremill.eu





Mime
View raw message