bipface
02/26/17 04:23AM
Okay here's a better comparison I got with a packet sniffer:

gist.github.com/bipface/75fb21b5e4518adba6ce4cfff52c00f1

The first one is a message sent from the /index.php?page=gmail&s=send_pm&action=reply page.
It turned out blank.
Note that the ellipses are encoded as ANSI/CP1252 ; if interpreted as UTF8 it's probably malformed.

The second one is the same message sent from the /index.php?page=gmail&s=send_pm page.
It was received correctly.
Not that these ellipses are encoded as UTF8 (E2 80 A2).

So the question is, why does Firefox decide to use ANSI on one page and UTF8 on the other …

And it turns out the reason is that the /…&s=send_pm page is reached through a GET request, while the /…&s=send_pm&action=reply page is reached through a POST request.

Notice how the error messages differ depending on the method:
GET: i.imgur.com/2J2GoL5.png
POST: i.imgur.com/iQFc27s.png

Firefox uses the correct encoding for the GET page because it's able to reload it once it finds the encoding declaration. It can't reload the POST page because that would result in the POST data being submitted twice.

So there you go. Move the tag
<meta http-equiv="content-type" content="text/html; charset=utf-8">
to an earlier point in the page, or serve it with UTF-8 in the HTTP headers, and the problem should be fixed.
<<<1 2


Reply | Forum Index