Hell! I have been struggling on this problem for more than 2 months, and finally got an answer, and that’s related to MariaDB and mySQL. At this stage, I am still confused with whether this is the FINAL and REAL answer.
I am recording the whole process of bug discovery below here, but in a nutshell:
- Got empty empty responseText from jQuery AJAX call
- Got the parseError from the JQuery AJAX call
- Found the source of the error, which is caused by the json_encode function in PHP
- Compared the var_dump of the variable being json_encode from mySQL and MariaDB, the output is different
- Output frommySQL one has strange character (ASCII code 130), whileMariaDB does not
- Remind me that mySQL allows the PHP to read and write emoticon from and into the database
- But, MariaDB does not
- In conclusion for now, mySQL supports I/O of more unicode characters than MariaDB does (but Asian characters are also supported)
- After removing the strange characters from themySQL database, problem solved.
- Reason is due to the fact that json_encode supports only UTF-8
All string data must be UTF-8 encoded.