I'm making a plugin that broadcasts strings from a MySQL database, but when I'm using a special character like "å, ä, ö" it doesn't show up. In the console the character changes into "?" and on the client the message is being cut of where the character should be. The database has UTF-8 encoding, so it's supposed to work. How can I fix it?
Why the hell does it not send the data in UTF-8 when it's encoded that way? That's stupid. xD It was fixed by setting the charset: http://php.net/manual/en/mysqli.set-charset.php
Even more stupid: mysqli_result->fetch_***() returns values in strings while it is an INT on the database. (Probably limitation of the MySQL protocol) I spent a whole week to fix bugs caused by that (and failed to release server on Christmas )
I had code that detects if a variable is a string, wrap it with " And then I also have code that if the variable is expected to be a number, cast it to int. So I spent 1 day finding out that the user ID became 0, that's why all player data are overlapping Then I spent 2 days locating the place that it became 0 Then I spent 1 day to find out that it has always been a string since fetched from MySQL. Then I spent 2 days to fix that in the whole LegionPE Eta plugin.
Actually.. Just a question, maybe related to this issue. I've got my chat to be able to save emojis into my db. I have UTF8_d4 or so as encoding. Also when i open the database in PMA (php my admin), i see the emojis. But i can't display them in my chat.. i tried to use komodo_emoji (a project on github), but anyways.. is there atleast a way so it shows the emojis in my chat?