I have this problem for a while, and drives me crazy.
It's very simple: I just want to use Japanese characters (kana and kanji)
in the "content-disposition" HTTP header:

    response.setHeader("Content-Disposition", "inline; filename=" +
fileName); // filename is a String object

Using this I get garbage in IE and Firefox. I checked out the related RFC
and it explains that I have to transcode it to "B" encoding.
I've tried this and other hints found over the web, but none of those
worked for all the 3 browsers: IE, Firefox and Opera. (The priority is on
IE, it's used by the majority of our end-users.)

E.g. I've desperately tried:

    response.setHeader("Content-Disposition", "inline; filename=" + new
String(fileName.getBytes("UTF-8"), "ISO8859_1"));

    response.setHeader("Content-Disposition", "inline; filename=" +
fileName.getBytes("iso-2022-jp"));

    response.setHeader("Content-Disposition", "inline; filename=" +
MimeUtility.encodeWord(fileName, "iso-2022-jp", "B"));

    response.setHeader("Content-Disposition", "inline; filename=" +
MimeUtility.encodeWord(new String(fileName.getBytes()), "ISO8859_1",
"B"));

    response.setHeader("Content-Disposition", "inline; filename=" + new
String(fileName.getBytes("SJIS"), "ISO8859_1"));

Does anyone know the right webcontainer-independent, browser-independent
solution? I was writing about Japanese chars, but I guess there should be
a universal solution for any (Unicode) char.

Thanks a lot in advance.
Bye, Aron

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to