My autocomplete search feature is broken because of how characters with accents are stored in the mySQL.
For example, in the mySQL column, É is stored like \u00c9
In the PHP, which receives the user's input and calls on mySQL, É is \xc3\x89
json_encode() almost works perfectly to take "\xc3\x89" and convert it to "\u00c9"
$clean = json_encode($criteria, JSON_UNESCAPED_SLASHES); Except it converts it to "\\u00c9" and so the characters don't match even though they are both É.
The option JSON_UNESCAPED_SLASHES isn't working. Why does it not keep another backslash from being added in front of the backslash?
How do I get this to work?
Edit: I just added the actual code and error log output below. code:
error_log("criteria vvvvvvvvvvvvv"); error_log($criteria); $clean = json_encode($criteria, JSON_UNESCAPED_SLASHES); error_log("json_encode(criteria) vvvvvvvvvvvvvv"); error_log($clean); The error log:
[Fri Aug 23] criteria vvvvvvvvvvvvvvv, [Fri Aug 23 \xc3\x89 [Fri Aug 23] json_encode(criteria) vvvvvvvvvvvvvvv, [Fri Aug 23] "\\u00c9"
[24-Aug-2019 06:06:47 UTC] criteria vvvvvvvvvvvvv [24-Aug-2019 06:06:47 UTC] É [24-Aug-2019 06:06:47 UTC] json_encode(criteria) vvvvvvvvvvvvvv [24-Aug-2019 06:06:47 UTC] "\u00c9"$criteriavariable. and make sure it's not holding this string\u00c9and if you managed to resolve the issue please let me know. Good luck