UTF8 characters in the MySQL table (umlauts, etc.) are not showing up in the Editor's HTML or JSON

UTF8 characters in the MySQL table (umlauts, etc.) are not showing up in the Editor's HTML or JSON

AsparagirlAsparagirl Posts: 4Questions: 0Answers: 0
edited May 2013 in Editor
Hi there. I have a MySQL table that has some cells that have UTF-8 characters in it, such as words with umlauts. But those pieces of data are not showing up in the HTML front-end where I am running Editor, and they're not showing up in the JSON either (I am running it server-side). I saw this thread regarding a similar issue in DataTables...

http://www.datatables.net/forums/discussion/9259/german-umlaut-ue-etc.-not-showing-server-side-scripting/p1

...but I'm not sure how to adapt that for the Editor architecture and the PDO stuff. Suggestions?

Thanks.


- Brooke

Replies

  • allanallan Posts: 56,187Questions: 1Answers: 8,897 Site admin
    Hi Brooke,

    You would do something like this:

    [code]
    $db->sql("SET character_set_client=utf8");
    $db->sql("SET character_set_connection=utf8");
    $db->sql("SET character_set_results=utf8");
    [/code]

    Or better yet, use UTF8 encoding in the database.

    Allan
  • AsparagirlAsparagirl Posts: 4Questions: 0Answers: 0
    Thanks, but to which file should I add those three lines?

    (Oddly enough, the database is already using UTF-8 format.)
  • allanallan Posts: 56,187Questions: 1Answers: 8,897 Site admin
    In Bootstrap.php you'll see `$db = new Database( $sql_details );` - add them in after that line and they'll be executed whenever you include Bootstrap.php.

    Regards,
    Allan
This discussion has been closed.