Closed
Bug 457845
Opened 16 years ago
Closed 7 years ago
Firefox 3.0.3: responseText of XMLHttpRequest receives wrong characters from server
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: mobbe, Unassigned)
Details
Attachments
(12 files, 1 obsolete file)
52.47 KB,
application/pdf
|
Details | |
86.48 KB,
application/pdf
|
Details | |
125.22 KB,
text/plain
|
Details | |
93.67 KB,
text/plain
|
Details | |
125.67 KB,
text/plain
|
Details | |
94.20 KB,
text/plain
|
Details | |
125.40 KB,
text/plain
|
Details | |
98.56 KB,
text/plain
|
Details | |
126.16 KB,
text/plain
|
Details | |
94.51 KB,
text/plain
|
Details | |
124.40 KB,
text/plain
|
Details | |
95.79 KB,
text/plain
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; it; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; it; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3
Until yesterday I used Firefox 2.0.0.17 and all applications worked good.
My web applications use XMLHttpRequest. I receive from server the answer in responseText and the string in responseText is: rtcd=0¶
Today I installed Firefox 3.0.3 and the same applications receive in responseText this wrong string: rtcd=0¶
Firefox 3.0.3 add the character Â
The same happens if server answer the characters £ and §, Firefox add the character  before the correct character.
The most of our web applications cannot work with Firefox 3.0.3, my company cannot use this new version.
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Reporter | ||
Comment 1•16 years ago
|
||
This attachment contains the source html of my application
Reporter | ||
Comment 2•16 years ago
|
||
I have the same problem using Firefox 3.0.3 for linux
Reporter | ||
Comment 3•16 years ago
|
||
This attachment contains the source html of my application and the print-screen of the responseText using Firefox 2.0.17 and 3.0.3
Attachment #341091 -
Attachment is obsolete: true
Updated•16 years ago
|
Severity: critical → major
Component: General → DOM: Mozilla Extensions
Product: Firefox → Core
QA Contact: general → general
Comment 4•16 years ago
|
||
Monica, could you please tell me what encoding your server sends the string in? What headers does it send?
Reporter | ||
Comment 5•16 years ago
|
||
Hi Boris, my server use default charset ISO-8859-1.
My document.characterSet is ISO-8859-1.
Yesterday I have tested different situations using firefox 2 and firefox 3.
I add you the attachment with the results I have obtained.
Using test case 4 I obtain the correct characters in both versions, but my applications lost compatibility with IE that doesn't recognize overrideMimeType and no longer works.
Why using the same application with the same setRequestHeader and overrideMimeType , the results using version 2 and 3 are different?
How can I have correct results from firefox 3 without lost compatibility with IE?
Reporter | ||
Comment 6•16 years ago
|
||
This document contains different test case and the result I have obtained.
Comment 7•16 years ago
|
||
> Hi Boris, my server use default charset ISO-8859-1.
That doesn't answer my question. It sure looks to me like it's sending back UTF-8 and claiming it's ISO-8859-1 or something.
Does it base the bytes it sends on the bytes it receives? Note that Firefox is sending it UTF-8. Does it send the same bytes to Firefox 2 and Firefox 3?
Could you perhaps create an HTTP log of the failing case following the instructions at http://www.mozilla.org/projects/netlib/http/http-debugging.html and attach it to this bug? And do the same for the same testcase in Firefox 2?
Reporter | ||
Comment 8•16 years ago
|
||
The log contains these steps using Firefox 2.0.17:
1) open firefox 2.0.17
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/vq10rh1h.cgi
look to "example of my application" attachment to see the setting.
Reporter | ||
Comment 9•16 years ago
|
||
The log contains these steps using Firefox 3.0.3:
1) open firefox 3.0.3
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "example of my application" attachment to see the setting.
Reporter | ||
Comment 10•16 years ago
|
||
The log contains these steps using Firefox 2.0.17:
1) open firefox 2.0.17
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 1) to see the setting.
Reporter | ||
Comment 11•16 years ago
|
||
The log contains these steps using Firefox 3.0.3:
1) open firefox 3.0.3
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 1) to see the setting.
Reporter | ||
Comment 12•16 years ago
|
||
The log contains these steps using Firefox 2.0.17:
1) open firefox 2.0.17
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 2) to see the setting.
Reporter | ||
Comment 13•16 years ago
|
||
The log contains these steps using Firefox 3.0.3:
1) open firefox 3.0.3
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 2) to see the setting.
Reporter | ||
Comment 14•16 years ago
|
||
The log contains these steps using Firefox 2.0.17:
1) open firefox 2.0.17
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 3) to see the setting.
Reporter | ||
Comment 15•16 years ago
|
||
The log contains these steps using Firefox 3.0.3:
1) open firefox 3.0.3
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 3) to see the setting.
Reporter | ||
Comment 16•16 years ago
|
||
The log contains these steps using Firefox 2.0.17:
1) open firefox 2.0.17
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 4) to see the setting.
Reporter | ||
Comment 17•16 years ago
|
||
The log contains these steps using Firefox 3.0.3:
1) open firefox 3.0.3
2) open bookmark and choose /cgigrp/testwnd.cgi
3) click submit and execute XMLHttpRequest for /cgigrp/testwndh.cgi
look to "test case" attachment (case 4) to see the setting.
Reporter | ||
Comment 18•16 years ago
|
||
Mistake in description of attachment id=341592 the XMLHttpRequest is for /cgigrp/testwndh.cgi (not for /cgigrp/vq10rh1h.cgi). Sorry.
Comment 19•16 years ago
|
||
So Fx2 sends:
Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
Fx3 sends:
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Your server responds to Fx2 with:
Content-Type: text/html; charset=ISO-8859-1
and responds to Fx3 with:
Content-Type: text/html; charset=ISO-8859-1;text/html; charset=ISO-8859-1;erxt/html; charset=ISO-8859-1;erst/html
I would guess the issue is the server messing up the decoding of the urlencoded data somehow (e.g. assuming that the charset param says something about the decoded data, not the encoded data).
Comment 20•16 years ago
|
||
Those sends/receives pairs were for the "actual set of my applications" attachments.
Reporter | ||
Comment 21•16 years ago
|
||
In test case 1:
setRequestHeader("Content-Type", "application/x-www-form-urlencoded;
charset=ISO-8859-1");
FF2 sends:
Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
FF3 sends:
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Why FF3 sends UTF-8 when setRequestHeader is ISO-8859-1?
Comment 22•16 years ago
|
||
Because the data it's actually sending is in UTF-8, just like in Fx2. Of course in this case the data is all-ASCII, so there is no difference in terms of what bytes are sent. But it sounds like the server is misusing the charset param to mean the encoding of the bytes once the data is unescaped, as I said in comment 19. That's not what the charset param means.
Comment 23•16 years ago
|
||
var req = new XMLHttpRequest();
var mode = false
req.open('GET', url, mode);
req.overrideMimeType('text/plain; charset=x-user-defined');
req.onreadystatechange = function() {
if(req.readyState == 3) {
alert(req.responseText.charCodeAt(0) & 0xff);
}
}
req.send(null);
if(!mode){
alert('NSYNC');
alert(req.responseText.charCodeAt(0) & 0xff);
}
Url may points to any binary file with first byte > ANSI range
If var mode = false this function dispays the same correct result in Firefox 2.0.0.20 and Firefox 3.0.5.
If var mode = true Firefox 2 works in the same correct way when Firefox 3 dispayes incorrect byte code.
Comment 24•16 years ago
|
||
That doesn't sounds related to this bug. Please file a new bug on that, and cc me, ok?
Comment 25•12 years ago
|
||
Comment on attachment 341100 [details]
example of my application
is it sill coming..? i'm unable to download the attachment..
Assignee | ||
Updated•12 years ago
|
Component: DOM: Mozilla Extensions → DOM
Comment 26•7 years ago
|
||
There's not enough information here to reproduce the problem.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•