Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

[Solved] Character set problems latin1 and utf-8 in VanillaForums*

edited February 2011 in Vanilla 2.0 - 2.8
I know Vanilla uses PDO for connecting to MySQL. But I need it to use my existing database that was created with mysql_query before. (a part of integration)
I did use mysql_query with "set names utf8", now I create new app in Vanilla that uses this data. My app outputs wrong utf-8 characters.
When looking into database, I see PDO in Vanilla encodes utf-8 different from mysql_query although both of them using "set names utf8" and "utf8_unicode_ci" collation.
How can PDO in Vanilla and mysql_query live together?

Comments

  • Options
    ToddTodd Chief Product Officer Vanilla Staff
    edited February 2011
    I've never seen this problem, but encoding issues can be a real pain. Are you sure your tables are utf8? Try show create table [TableName] in mysql.
  • Options
    edited February 2011
    Thanks Todd.
    I find the root cause when executing [SHOW VARIABLES LIKE 'character%'] command. My MySQL server shows:
    character_set_database latin1
    character_set_server latin1
    When installing Vanilla, it sets my db to latin1 though my eyes see utf8_unicode_ci.
    My old data is truly utf-8.
    Now I have to convert them into the same characterset.
  • Options
    When installing Vanilla, it sets my db to latin1 though my eyes see utf8_unicode_ci.
    Great find! Would you mind if I edited the title a bit, so we can give this topic extra tags and continue to figure out how to fix the problem?

    There was an error rendering this rich post.

  • Options
    @UnderDog: You're welcome :)
Sign In or Register to comment.