How to encode non-ASCII characters in the Content-Disposition
How to encode non-ASCII characters in the Content-Disposition
- Subject: How to encode non-ASCII characters in the Content-Disposition
- From: Miguel Arroz <email@hidden>
- Date: Fri, 6 Mar 2009 23:49:19 +0000
Hi!
I have an element that I use to download files, that sets the
filename in the Content-Disposition header like this:
response.setHeader("attachment; filename=\"" +
fileData.name().replace("\"", "\\\"") + "\"", "Content-Disposition");
Although this works for ASCII characters, it's corrupting filenames
with non-ASCII chars, like arabic, chinese, etc. I'm trying to
understand how to make this work, but the more I dig trough RFCs the
more pissed off I get. Does anyone have already solved this issue and
is kind enough to copy/paste the code snippet? :)
Yours
Miguel Arroz
...........................
http://www.survs.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden