Hi, we have a web application that is used mainly on mobile phones. The users are writing messages with emojis in a form, posting the form, and MODX is sending it to the database. When the message is displayed on the webpage the emojis is gone. When I check in the database there are no trace of the emoji-"weird-code" there.
We have tested with a field that is outside modx that post the text with emoji to the database that has the same charset that the MODX database has, utf-8-general-ci, and then the emoji-"strange-code" is posted in the database and I can see it in the field, and when we get the data from the database we get the emoji back and everything works.
The way we post data to the database is by using xpdo and newObject() and save(). Is there something in that method that strips away the emoji-code from the userinput?
How can we allow the emoji codes to come unharmed into the database and unharmed out from it?
...I believed it was Friday...
Maybe striptags is switched on for the method of form submission you are using?
Quote from: andytough at Sep 30, 2016, 12:13 PMMaybe striptags is switched on for the method of form submission you are using?
There is something that does it that looks like a stripping of tags. I solved it, but in an ugly way.
I create a new object and save that, then I connect to the database old school with mysqli and write the field with smileys/emojis into the database.
When I get the data from the database I have to ask with mysqli and not with $modx->getObject();
This feels dirty, and I am wondering if there are some fix to the xpdo that let emojis be saved and retreived without stripping them.
...I believed it was Friday...