There must be something strange I'm doing then. Our main platform runs 5.3.3, and local dev server at work 5.3.21, and my dev server at home 5.4.12 - all of them have the same problem.
I've now simplified everything we're doing into one script, and tested on all of the above platforms.
Code: Select all
<?php
if (isset($_POST["message"])) {
$message = $_POST["message"];
$__message = mb_convert_encoding($message, 'UCS-2','auto');
$unicode_message = strtoupper(bin2hex($__message));
echo ("Unicode: ".$unicode_message."<br />");
echo ("Message:");
var_dump(mb_convert_encoding(hex2bin($unicode_message), 'UTF-8', 'UCS-2'));
}
?>
<form accept-charset="utf-8" method="post">
<textarea name="message"><?=$_POST["message"]?></textarea>
<input type="submit" />
</form>
in all cases, "Unicode" comes out as 0160 (which is correct) but "Message" always returns "Å "
This is really baffling me, and I wonder if I'm missing something really obviousy.
BTW - this last test script is literally just the above, so everything else is defined in the php.ini files etc, which are out of the box and haven't been changed (except some file locations etc).
Again, any help gratefully received...
Thanks