Skip to content

Instantly share code, notes, and snippets.

@masakielastic
Created August 4, 2017 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masakielastic/018d36707d3f746fb648e2695a748703 to your computer and use it in GitHub Desktop.
Save masakielastic/018d36707d3f746fb648e2695a748703 to your computer and use it in GitHub Desktop.
<?php
$a = chr(0xfa).chr(0x4a);
var_dump(
"fa4a" === bin2hex($a)
);
$a = mb_convert_encoding($a, "UTF-8", "CP932");
$a = mb_convert_encoding($a, "CP932", "UTF-8");
var_dump(
"8754" === bin2hex($a)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment