Atlassian JIRA   History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: XRP-128
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Reporter: Kristof Van Cleemput
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
xReporter

Missing encoding in http-header gives encoding problems

Created: 26/Jul/07 07:21 AM   Updated: 11/Sep/07 07:08 AM
Component/s: xReporter
Affects Version/s: 1.3
Fix Version/s: 1.3


 Description   
If you use the csv conversion of xreporter (get text) the encoding is not passed to the http-header .
Because of this the file is opened with the encoding of the browser.
When fi the file is latin1 and the browsers encoding is UTF-8 all special characters are corrupted. The user then saves the file and offcourse the file is saved as UTF-8 with a corrupted xsl file as result.
(seen using Live httpheaders plugin in firefox)
You can change the browser encoding with view / character encoding

mpo will check this with jh

 All   Comments   Change History      Sort Order:
Comment by Kristof Van Cleemput [26/Jul/07 09:06 AM]
It seems that internet explorer doesn't behave the same way as firefox.
So test with both browsers.
Maybe the default encoding of the system has also something to do with it.
Anyway changing the httpheader should fix this problem


Comment by Marc Portier [17/Aug/07 10:22 AM]
Below are to traces of HTTP messages passing along that show the issue.
You can see that in both cases the server is replying with the same charset on the content-type.

Checking fast on the code it shows that the encoding to use is not passed as a parameter to the serializer, but injected in the XML stream. This makes the info however only available at the time the sax-events are passing through the pipe, apparently this is too late for the content-type to be changed....


1/ asking for a report in csv output utf-8 encoded:
--------------------------------------------------------------------------------
http://intranet/xreporter/nl-BE/report-a_352.txt?encoding=UTF-8&lineSeparator=dos&splitCharacter=comma&includeTitles=true



GET /xreporter/nl-BE/report-a_352.txt?encoding=UTF-8&lineSeparator=dos&splitCharacter=comma&includeTitles=true HTTP/1.1

Host: intranet

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20061201 Firefox/2.0.0.5 (Ubuntu-feisty)

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: nl-be,en-us;q=0.7,en;q=0.3

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://intranet/xreporter/nl-BE/reports/a_352/output

Cookie: daisyEditorHeight=800; locale=nl_BE



HTTP/1.x 200 OK

Date: Fri, 27 Jul 2007 21:44:26 GMT

Server: Jetty/4.2.22 (Linux/2.6.15-28-server i386 java/1.5.0_06)

X-Cocoon-Version: 2.1.6

Content-Type: text/plain; charset=UTF-8

Via: 1.1 intranet

Transfer-Encoding: chunked




2/ asking for a report in csv output latin-1 encoded:
--------------------------------------------------------------------------------
http://intranet/xreporter/nl-BE/report-a_352.txt?encoding=ISO-8859-1&lineSeparator=dos&splitCharacter=comma&includeTitles=true



GET /xreporter/nl-BE/report-a_352.txt?encoding=ISO-8859-1&lineSeparator=dos&splitCharacter=comma&includeTitles=true HTTP/1.1

Host: intranet

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.5) Gecko/20061201 Firefox/2.0.0.5 (Ubuntu-feisty)

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: nl-be,en-us;q=0.7,en;q=0.3

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Referer: http://intranet/xreporter/nl-BE/reports/a_352/output

Cookie: daisyEditorHeight=800; locale=nl_BE



HTTP/1.x 200 OK

Date: Fri, 27 Jul 2007 21:46:18 GMT

Server: Jetty/4.2.22 (Linux/2.6.15-28-server i386 java/1.5.0_06)

X-Cocoon-Version: 2.1.6

Content-Type: text/plain; charset=UTF-8

Via: 1.1 intranet

Transfer-Encoding: chunked

Comment by Bruno Dumon [11/Sep/07 07:08 AM]
Fixed in SVN rev 696.