Open Bug 1567367 Opened 6 years ago Updated 2 years ago

multipart/form-data encoding on windows is not utf8

Categories

(Core :: DOM: Core & HTML, defect, P3)

60 Branch
Unspecified
Windows 7
defect

Tracking

()

Tracking Status
firefox-esr60 --- affected
firefox68 --- affected
firefox69 --- affected
firefox70 --- affected

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|

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.

Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
OS: Unspecified → Windows 7
Product: Firefox → Core

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 :)

Flags: needinfo?(alchen)
Priority: -- → P3

I will try to find time to investigate this bug this week.

Flags: needinfo?(alchen)

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.

Flags: needinfo?(andrei.vaida)

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.

(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.

Flags: needinfo?(andrei.vaida) → needinfo?(rpopovici)
Attached video clip-1-1.mov
Flags: needinfo?(rpopovici)

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.

Flags: needinfo?(alchen)
Attached video win7bug.mp4

Sorry for the wrong video. It was from another bug. Can you please see win7bug.mp4?
Thank you.

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?

Flags: needinfo?(alchen) → needinfo?(rpopovici)

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 ?

Flags: needinfo?(rpopovici) → needinfo?(alchen)

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|

Flags: needinfo?(alchen)

(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.

Flags: needinfo?(rpopovici)

Could you also try Edge or IE on Win7?
yes, IE sends the malformed POST as well

(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

Hi alchen,
I tried on IE too. This is my result(you can see the screenshot attached). It might be a Win 7 issue.

Flags: needinfo?(rpopovici) → needinfo?(alchen)
Attached image utf8-IE.png

(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.

Flags: needinfo?(alchen)
Severity: normal → S3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: