DIGIT-ARC read-only archive · snapshot: July 23, 2026

Java

6 posts · originally from https://geek.digit.in/community/threads/java.4506/

Doddy
Doddy Original post #1
Jan 9, 2005 at 6:25 PM
Hi,
I am using Java mail 1.3.1 in JDK 1.2

When I read email attachments, I get attachment names like below:
"=?windows-1254?Q?myfile=2Ejpg?=" for "myfile.jpg"
I use javax.mail.internet.MimeBodyPart's getFileName method.

How can I remove this encoding, I tried java.net.URLDecoder
but doesn't work?
#/bin/sh
Jan 9, 2005 at 9:10 PM
Think you'll need to determine the encoding used by whatever created the email.
Doddy
Doddy #3
Jan 10, 2005 at 12:48 PM
We are using Lotus. How can I decode this encoding?
When we read this email in Lotus, attatchments are properly named which
is in my example "myfile.jpg". I nedd to remove and convert other characters.
#/bin/sh
Jan 10, 2005 at 2:35 PM
what if you read them in another mail read, outlook or eudora for example?
Doddy
Doddy #5
Jan 10, 2005 at 4:36 PM
if I read them in another mail read, outlook or eudora, what will happen then?
They don't use java mail. Somehow I have to remove extra characters. I don't want to write my own decoder if one is already there.
#/bin/sh
Jan 10, 2005 at 9:15 PM
get the headerfields and then use:
javax.mail.internet.MimeUtility.decodeText(field.getValue());

but with java 1.3.1 most of the encodings used nowadays are not supported! Update to at least 1.4.1 recommend 5