RE: Problem in downloading a pdf file having Japanese characters in the name of the file

Hi Steve,

Thanks a lot for sharing the information. I'm yet to implement the
approach.

Regards,
Sourav

-----Original Message-----
From: Steve Billings [mailto:billings@global360.com]
Sent: Thursday, October 30, 2003 10:53 PM
To: souravm; www-international@w3.org
Subject: RE: Problem in downloading a pdf file having Japanese
characters in the name of the file

I wrestled with this problem earlier this year, and unfortunately found
no
good solutions. As far as I can tell (and I hope someone can prove me
wrong), it's a yet-to-be solved problem in the internet infrastructure.
I
was using recent versions of IE and Netscape browsers, and a not-so-new
version of Tomcat (3.something, I think).

The approach that came closest to working was to encode the filename
using
URLEncoder
(http://java.sun.com/j2se/1.4.1/docs/api/java/net/URLEncoder.html) with
UTF-8, and set the Content-Disposition according to RFC 2047 as follows:
String encoded_filename = URLEncoder.encode(filename, "UTF-8");
String contentDisp = "=?UTF-8?Q?attachment; filename=" +
encoded_filename +
";?=";
res.setHeader("Content-Disposition", contentDisp);
With this approach, if the Japanese filename is short, when you save the
file from the browser, everything looks fine. If you open it without
saving
it, Notepad gets the encoded name (bad). Another problem is that this
approach can only handle filenames up to about 17 Japanese characters.

I tried using other standards (RFC 2184, RFC 2231) with no success.

It wasn't available to me in Tomcat, but this looked like it might have
some
promise:
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/mail/internet/MimeUt
ilit
y.html

I hope you find a solution. If you do, please share it!
Steve

Steve Billings
Global 360
Software Internationalization & Localization
http://www.global360.com/
Office: 978-266-1604
Cell:    978-697-8201

-----Original Message-----
From: www-international-request@w3.org
[mailto:www-international-request@w3.org]On Behalf Of souravm (by way of
Martin Duerst <duerst@w3.org>)
Sent: Tuesday, October 28, 2003 9:30 PM
To: www-international@w3.org
Subject: Problem in downloading a pdf file having Japanese characters in
the
name of the file




Hi All,

I've a pdf file available in a solaris file server. The name of the file
contains Japanese characters.

I'm trying to download this file using a Servlet. For that purpose I'm
setting -

res.setContentType("application/pdf");
res.setHeader("Content-disposition", "inline; filename=" + fileName);

This filename is a Unicode string contaiing some Japanese characters.

The download is not happening in this case. However, if the filename
contains English Characters it works fine.

Could anyone please let me know what is the problem and the solution for
it ?

Thanks in advance.

Regards,
Sourav

Received on Monday, 3 November 2003 06:58:52 UTC