phpgbk

How to make the browser displays this hexadecimal value (in GBK)?


If i do echo(0xbf5c); it renders 0xbf5c. But it normally correspond to a chinese letter. How can i make this latter displayed ?

Thanks


Solution

  • Split the character into individual bytes and use PHP's \xhh (character with hex code hh) escape character in a double-quoted string:

    header("Content-Type: text/plain; charset=GBK");
    echo "\xbf\x5c";
    

    You won't need the header line if your webserver is already configured to use the GBK charset.