Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wrong attachment file name with non-ASCII character.

843834Mar 18 2010 — edited Mar 25 2010
Hi all,
I have read an email with an attchment which has non-ASCII file name from Exchange Server 2003, when I read the attachment file name using part.getFileName(), it just return µØÖ·.txt. I have set the following system properties:
System.setProperty("mail.mime.decodefilename", "true");
System.setProperty("mail.mime.decodeparameters", "true");

Can anybody help me to resolve this problem?

The following is the email content:

Received: by geneva.gearteks.local
id <01CAC694.7B8A3016@geneva.gearteks.local>; Thu, 18 Mar 2010 20:13:56 +0800
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----_=_NextPart_001_01CAC694.7B8A3016"
Content-class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft Exchange V6.5
Subject: =?gb2312?B?ztK/udLpOHRoTWFuYWdl?=
Date: Thu, 18 Mar 2010 20:13:25 +0800
Message-ID: <CF4A4EB4706E934D93A2114E898F6678261BC1@geneva.gearteks.local>
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
Thread-Topic: =?gb2312?B?ztK/udLpOHRoTWFuYWdl?=
Thread-Index: AcrGSvaa45oGTzMrSvy49JaupGruywAAE2LAAAAZ02AAAL7a8AAE1N0QAAAU1AAAADZBYAAAHK9gAAA0ydAAAC/cEAAADtJwAAAVHXAAAaj+kAAAVx+wAADqxgAAAB564AAAeLaQAACHlDAAABVgMAAAigCQAALcbFAAA3Be8AAADzPwAABCRwAAACyUsAAAHtWgAAAXYtA=
From: "Eric Chen" <ericchen@wisagetech.com>
To: "tester3" <tester3@wisagetech.com>

This is a multi-part message in MIME format.

------_=_NextPart_001_01CAC694.7B8A3016
Content-Type: multipart/alternative;
boundary="----_=_NextPart_002_01CAC694.7B8A3016"


------_=_NextPart_002_01CAC694.7B8A3016
Content-Type: text/plain;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

=C8=E7=CC=E2=A1=A3

=20

=D0=BB=D0=BB=A1=A3


------_=_NextPart_002_01CAC694.7B8A3016
Content-Type: text/html;
charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:=CB=CE=CC=E5;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@=CB=CE=CC=E5";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal;
font-family:Arial;
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle19
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle20
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle21
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle22
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle23
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle24
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle25
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle26
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle27
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle28
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle29
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle30
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle31
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle32
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle33
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle34
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle35
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle36
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle37
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle38
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle39
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle40
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle41
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle42
{mso-style-type:personal;
font-family:Arial;
color:navy;}
span.EmailStyle43
{mso-style-type:personal-reply;
font-family:Arial;
color:navy;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
</style>

</head>

<body lang=3DZH-CN link=3Dblue vlink=3Dpurple =
style=3D'text-justify-trim:punctuation'>

<div class=3DSection1 style=3D'layout-grid:15.6pt'>

<p class=3DMsoNormal><font size=3D1 color=3Dnavy =
face=3D=CB=CE=CC=E5><span style=3D'font-size:9.0pt;
font-family:=CB=CE=CC=E5;color:navy'>=C8=E7</span></font><font size=3D1 =
face=3D=CB=CE=CC=E5><span
style=3D'font-size:9.0pt;font-family:=CB=CE=CC=E5'>=CC=E2=A1=A3</span></f=
ont><font size=3D1 face=3DArial><span
lang=3DEN-US =
style=3D'font-size:9.0pt;font-family:Arial'><o:p></o:p></span></font></p>=


<p class=3DMsoNormal><font size=3D1 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
9.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=3DMsoNormal><font size=3D1 face=3D=CB=CE=CC=E5><span =
style=3D'font-size:9.0pt;
font-family:=CB=CE=CC=E5'>=D0=BB=D0=BB=A1=A3</span></font><font size=3D1 =
face=3DArial><span lang=3DEN-US
style=3D'font-size:9.0pt;font-family:Arial'><o:p></o:p></span></font></p>=


</div>

</body>

</html>

------_=_NextPart_002_01CAC694.7B8A3016--

------_=_NextPart_001_01CAC694.7B8A3016
Content-Type: text/plain;
name="=?gb2312?B?tdjWty50eHQ=?="
Content-Transfer-Encoding: base64
Content-Description: =?gb2312?B?tdjWty50eHQ=?=
Content-Disposition: attachment;
filename="=?gb2312?B?tdjWty50eHQ=?="

uv6xscqhzuS6usrQuunJvcf4tqvQxcK3NbrFILfpu/DNqNDFuavLviDUy9OqudzA7bK/ICAgICAg
ICAgDQrTyrHgo7ogNDMwMDc0

------_=_NextPart_001_01CAC694.7B8A3016--
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 22 2010
Added on Mar 18 2010
6 comments
733 views