You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2005/03/26 14:05:50 UTC
DO NOT REPLY [Bug 34189] New: -
header encoding issue
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34189>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=34189
Summary: header encoding issue
Product: Tomcat 5
Version: 5.5.7
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: cserveny.tamas@gmail.com
Hi,
I've seen lots of encoding related problems with requests, but not a single one
on response headers. So i decided to file this report.
My problem follows:
I've written a CSV export functionality to my program. My servlet inserts a
"Content-Disposition" header into the response, in order to set the filename of
the result csv file. This works fine till I want to insert chars not included in
iso8859-1 encoding, like the accented o char �� or u ��. They are converted to a
Qq Pp in the output. (I've checked with ethereal, it is not a client problem)
The character '�' has a hibyte. (its unicode value is higher than 256) and if
that hibyte removed it will turn into a 'Q'.
This transformation therefore indicates a lack of char -> byte conversion for
headers, just a plain cast.
The code follows:
res.setContentType("text/comma-separated-values");
res.setCharacterEncoding("ISO8859-2");
res.setHeader("Content-Disposition", "attachment; filename=\"" + report + ".csv\"");
eg.
report="vev�" would yield vevQ.csv in the browser.
I was not able to pinpoint the code segment responsible for converting header
strings to a byte stream.
I hope i was informative enough to resolve the issue.
Best regards,
Tamas
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org