I'm porting a PHP Web application I wrote from MySQL 5 to SQLite 3. The text encoding for both is UTF-8 (for all fields, tables, and databases). I'm having trouble transferring a geo database with special characters.
mb_detect_encoding()
detects both as returning UTF-8 data.
For example,
Raw output:
MySQL (correct): Dārāb, Iran
SQLite (incorrect): DÄrÄb, Iran
JSON-encoded:
MySQL (correct): D\u0101r\u0101b, Iran
SQLite (incorrect): D\u00c4\u0081r\u00c4\u0081b, Iran
What fixes the problem:
$sqlite_output = utf8_encode($sqlite_output);
$sqlite_output = utf8_decode($sqlite_output);
I imagine there's a way of repairing the SQLite database. Thank you in advance.