|
Posted by Erwin Moller on 03/27/07 11:42
ripley wrote:
> function decode_msg($msg)
> {
> $tmp = "";
> $msg = iconv("gb2312", "UCS-2", $msg);
> $len = strlen($msg);
>
> for ($i = 0; $i < $len; $i++)
> $tmp .= sprintf("%02X", ord($msg[$i]));
>
> return sprintf("%02X", strlen($tmp)/2).$tmp;
> }
>
> echo decode_msg("??");
>
> windows:
> 044F60597D
>
> linux:
> 04604F7D59
Hi,
Did you read the fine manual?
http://www.php.net/manual/en/ref.iconv.php
It describes the unreliable behaviour and advise you to implement GNU libs.
In the usercontributed notes you can even find a link to a W$-version.
Regards,
Erwin Moller
Navigation:
[Reply to this message]
|