The problem is not in MySQL. Actually, the fact that you get that unicode notation proves that the data is in fact interpreted as a UTF-8 character (and probably the right character as well ;)).
The problem is in encoding it to json. By default json_encode
escapes those characters.
That is not wrong by the way. You are allowed to escape them, but JSON also allows UTF-8 characters to be unescaped. JSON isn't meant to be human readable per se. It's just a format to send data over the line. The receiving party should be able to unescape the unicode sequence and show it as a ü.
Anyway, since JSON can also contain unescaped characters, you don't need to escape them, and you can tell json_encode
not to by passing a flag:
json_encode($myArray, JSON_UNESCAPED_UNICODE);
See json_encode function
and json constants
for more details.