StringManipulation
StringManipulation copied to clipboard
PHP option to escape non-ASCII characters to/from hex encoded bytes is missing
There is no option to escape/unescape characters to/from \xC2
format in PHP.
E.g. the character "À":
var_dump("\u{00C0}"==="À"); // bool(true)
var_dump("\xC3\x80"==="À"); // bool(true)
var_dump("\xC3\x80"==="\u{00C0}"); // bool(true)
It should be possible to escape "À"
to "\xC3\x80"
, and to unescape it back to "À"
afterwards.
Maybe I should remove the whole feature Un/Escape PHP feature. It is old and unmaintained.
Please don't remove it. I would find it very useful if it worked as I described above. I might even be willing to write a patch for it.