multipart/form-data encoding on windows is not utf8
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: nancie, Unassigned)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
Client: Firefox 60 esr on windows 7
Server: Apache on Linux
index.html:
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<form method="POST" enctype="multipart/form-data">
<textarea name="test">übermäßig</textarea>
<input type="submit"/>
</form>
</body>
</html>
file index.html:
index.html: HTML document, UTF-8 Unicode text
Actual results:
On submit:
tshark -Tfields -e http.file_data|xxd
Relevant part:
00000000 ef bf bd ef bf bd 62 65 72 6d ef bf bd ef bf bd |��berm��|
00000010 ef bf bd ef bf bd 69 67 0d 0a |��ig..|
Expected results:
On a linux client this works as intended
On submit:
tshark -Tfields -e http.file_data|xxd
Relevant part:
00000000 fc 62 65 72 6d e4 df 69 67 |übermäßig|
Comment 1•6 years ago
|
||
Hi, I reproduced this issue on my laptop(Win 7) with Fiirefox 60 esr, Firefox Release 68, Firefox Beta 69.0b7, Nightly 70.
On Win 10 works as intended.
Comment 2•6 years ago
|
||
This sounds possibly rather bad. Picking up a random victim to investigate this some more. Feel free to forward to someone else who might have more time :)
Comment 3•6 years ago
|
||
I will try to find time to investigate this bug this week.
Comment 4•6 years ago
|
||
Since I cannot find a Win 7 machine and don't find anything from code , ni QA for reproducing it.
Andrei, can your team try to reproduce the symptom on Win7?
Thanks.
Comment 5•6 years ago
|
||
nancie and QA, could you also check the formdata win7 or win10 sent?
You can use the web developer tool on firefox.
https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data
Check the "Viewing HTTP requests" section.
Comment 6•6 years ago
•
|
||
(In reply to Alphan Chen [:alchen] from comment #5)
nancie and QA, could you also check the formdata win7 or win10 sent?
You can use the web developer tool on firefox.
https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data
Check the "Viewing HTTP requests" section.
Hi Raluca,
could you check it for me?
Please also compare other browsers on Windows 7.
Thanks.
Comment 7•6 years ago
|
||
Comment 8•6 years ago
•
|
||
Hi Alphan Chen,
I opened the html in Firefox esr 60.8.0 esr, Nightly 70 and Chrome (Win 7) and I can reproduce the problem. I tried to check the formdata with steps from the link (comment 5) but I don't have any results in console. You can see the video with the problem.
On Win 10 works as intended.
Comment 9•6 years ago
|
||
Comment 10•6 years ago
|
||
Sorry for the wrong video. It was from another bug. Can you please see win7bug.mp4?
Thank you.
Comment 11•6 years ago
|
||
From video, you just open the index.html locally.
That's the reason why you don't have any result in the console.
However, we can see there are several "REPLACEMENT CHARACTER" in the text area.
original: übermäßig
on win7: bermig
ü, ä and ß are replaced.
Accroding to the video, the encoding is wrong even without a POST request.
The encoding problem is not related to "multipart/form-data".
(In reply to Raluca from comment #8)
Hi Alphan Chen,
I opened the html in Firefox esr 60.8.0 esr, Nightly 70 and Chrome (Win 7) and I can reproduce the problem.
Now we knew FF and Chrome have the same behavior.
Could you also try Edge or IE on Win7?
Comment 12•6 years ago
|
||
Yes, that's what I thought the problem was, that what I was able to reproduce in the first place, is that not the real issue here ?
Comment 13•6 years ago
|
||
The reporter is said that the server didn't get the right string.
Client: Firefox 60 esr on windows 7
Server: Apache on Linux
Send: übermäßig
Get:
(wrong) - windows 7
00000000 ef bf bd ef bf bd 62 65 72 6d ef bf bd ef bf bd |��berm��|
00000010 ef bf bd ef bf bd 69 67 0d 0a |��ig..|
(correct) (In reply to nancie from comment #0)
00000000 fc 62 65 72 6d e4 df 69 67 |übermäßig|
Comment 14•6 years ago
|
||
(In reply to Alphan Chen [:alchen] from comment #11)
Hi Alphan Chen,
I opened the html in Firefox esr 60.8.0 esr, Nightly 70 and Chrome (Win 7) and I can reproduce the problem.
Now we knew FF and Chrome have the same behavior.
Could you also try Edge or IE on Win7?
If Edge or IE on Win7 also have the same behavior, I will think it is a Win7 problem.
Comment 15•6 years ago
|
||
Could you also try Edge or IE on Win7?
yes, IE sends the malformed POST as well
Comment 16•6 years ago
|
||
(In reply to Alphan Chen [:alchen] from comment #5)
nancie and QA, could you also check the formdata win7 or win10 sent?
You can use the web developer tool on firefox.
https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data
Check the "Viewing HTTP requests" section.
I actually dont know what you expect from me.
The POST request is listed an its "Parameter" Tab contains the "multipart/form-data" encoded data (without replacement characters)
The Headers tab contains:
Response Headers:
Content-Type: text/html; charset=utf-8
Request Headers
Content-Type: multipart/form-data; boundary=...----......
Otherwise there is no encoding mentioned
Comment 17•6 years ago
|
||
Hi alchen,
I tried on IE too. This is my result(you can see the screenshot attached). It might be a Win 7 issue.
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
(In reply to Raluca from comment #17)
Hi alchen,
I tried on IE too. This is my result(you can see the screenshot attached). It might be a Win 7 issue.
Then we have consistent behavior on win 7.
I will consider this is an issue from the OS layer.
Updated•2 years ago
|
Updated•2 years ago
|
Description
•