I’m trying to convert characters, like À, to their escaped form, such as \u00c0. I know this can be done with json_encode, but the function adds backslashes to special characters. (I’m not actually hoping to get a json object, just string conversion):
$str = 'À ß \ Ć " Ď < Ĕ';
For the string above, it’ll return
$str = '\u00c0 \u00df \\ \u0106 \" \u010e < \u0114';
and if I stripslashes, it will also strip the one before each uxxxx.
Is there a function for this particular conversion? Or what is the simplest way to do it?
I know it uses json_encode(), but it’s the easiest way to convert to \uXXXX