Forum Moderators: coopster
To illustrate the problem, here's a simple test:
$in = $_REQUEST['in'];
header("Content-type: text/html; charset=UTF-8");
print "$in";
Save as test.php and then run it a web browser as: test.php?in=人気のロ
(Note that the garbage following the = sign would actually be 4 chinese characters if WW was capable of handling them and should be replaced with 4 similar characters if you decide to try the test)
If your browser is, say, Firefox, the output will be what you'd expect.
However if your browser is IE The output will be:
?ヲ?ヲ?ヲ?
(Note that there would be no ヲ's, only?'s in the actual test, the ヲ's are added because WW edits consecutive question marks EVEN if you put them in a code block)
I have confirmed that IE is, in fact, using UTF-8 to display the page.
This only happens with a GET request. If you POST the same characters using a form then IE behaves as you'd expect.
So am I correct in assuming that there is a bug in the way that IE encodes data from the address bar?
If so it seems unlikely that there is a workaround but if there is I would love to hear about it.
So am I correct in assuming that there is a bug in the way that IE encodes data from the address bar?
It would be only a minor bug compared to all the others ;-)
If so it seems unlikely that there is a workaround but if there is I would love to hear about it.
did you try:
<?php
if (!isset($_GET['in']))
{
header("Location: ".$_SERVER['PHP_SELF']."?in=".urlencode("人気のロ"));
}
else
{
header("Content-type: text/html; charset=UTF-8");
print $_GET['in'];
}
?>
or maybe some other form of encoding like base64
[nl3.php.net...]
[edited by: siMKin at 1:48 pm (utc) on Aug. 23, 2006]