1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Ä, Ö, umlauts and other characters after import

Discussion in 'Installation, Upgrade, and Import Support' started by Nnirvi, Feb 20, 2014.

  1. Nnirvi

    Nnirvi Member

    Hi!

    After an otherwise successful import, nordics are messed up. The usual ä and stuff you get when character set is somehow wrong. My question is, how should I proceed? The database is now UTF-8 with collation UTF-8_general_ci. I tested switching the collation to latin_swedish - no go.

    Do I need to import again or where should I start?
     
  2. HWS

    HWS Well-Known Member

    Could also be that your web server uses a wrong character set. Even your browser could be the culprit,
     
  3. Nnirvi

    Nnirvi Member

    On the same server I also have a Wordpress installation that displays everything fine. Also, new posts to the xF forum are displayed correctly
     
  4. Mike

    Mike XenForo Developer Staff Member

    In general, this means that a character set has to be forced at the beginning of the import -- this often comes up when an import is done on a different server or a different configuration from where the data lay originally (thus different default connection character sets). It's not possible to automatically detect.

    Normally, you need to force the charset to "latin1" at the import configuration stage if this happens. (This does involve redoing the import, which means either restoring to a pre-import backup or reinstalling XF.)
     
  5. Nnirvi

    Nnirvi Member

    No way to alter those characters? Search and replace? :)
     
  6. Mike

    Mike XenForo Developer Staff Member

    You can run queries to manipulate the data against the DB if you really want, but it will basically affect every field in the database that has non-basic ASCII characters in it.
     
  7. Nnirvi

    Nnirvi Member

    Ok. I guess it's new import then. So are these correct:

    The target db should be UTF-8?
    The target db collation should be latin1_swedish_ci?
    I should insert the option force character set to latin1? or latin1_swedish_ci?

    The source vB database's collation is latin1_swedish_ci.
     
  8. Mike

    Mike XenForo Developer Staff Member

    You can generally ignore DB table/collation in this case. The problem is likely that the old server had a connection character set of latin1 and the new server has utf8. This means that MySQL potentially converts the data to UTF-8 when we're expecting it to be in Windows-1252 (what vB uses as its charset), which leads to this double encoding.

    Specifying latin1 at the import config prevents MySQL from doing that silent conversion.
     
  9. Nnirvi

    Nnirvi Member

    Ok, thanks. Hopefully I see the Äs and Ös after the 3 hours the import takes :) At least the usernames seem correct in phpMyadmin.
     
  10. HWS

    HWS Well-Known Member

    This does not necessarily mean that your server and browser uses the correct character set for the data in your new XenForo database. Maybe your Wordpress data is latin-1?

    Since you now seem to have 2-byte characters, it looks for me like they are already UTF-8.
     
  11. Nnirvi

    Nnirvi Member

    This was resolved by forcing the charset in import. Thanks!
     
    HWS likes this.

Share This Page