Announcement

Collapse
No announcement yet.

utf8 encode problem when import phpbb3 -> vbb4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • utf8 encode problem when import phpbb3 -> vbb4

    Hi all,

    First issue I'm facing when import users:

    Issue: http://screenshotuploader.com/s/01/ymDvOLER

    Solution: http://screenshotuploader.com/s/01/x9tOBR6Li
    I have to change collation to from latin1_swedish_ci to utf8_general_ci then the error is fixed

    I continue with import forum, but it display as NOT as expected as below:
    web: http://screenshotuploader.com/s/01/5E4BL76I
    phpmyadmin:
    http://screenshotuploader.com/s/01/YIwT33E2E/

    phpmyadmin - original data:
    http://screenshotuploader.com/s/01/TEQYpyZ9d

    After investigation, I figure out that I have to change collation at table 'forum' for field 'title' and 'description' must be 'utf8_general_ci'.

    After change collation, the text is imported same as original:
    http://screenshotuploader.com/s/01/N0mfhzE7h

    >> I'd like to ask if we have another solution for this ? Do I have to change all collation to every field of vbb4 database ?! what is the use_utf8_encode and decode used for ?

    Please advise,

    Thanks in advance!

    FYI, the config I used:

    \impex\ImpExFunction.php
    PHP Code:
    // Advanced Target
    $impexconfig['target']['databasetype']    = 'mysql';    
    $impexconfig['target']['charset']        = 'utf8';
    $impexconfig['target']['persistent']    = false;     

    // Advanced Source
    $impexconfig['source']['charset']        = 'utf8';
    $impexconfig['source']['persistent']    = false;

    //utf8
    define('use_utf8_encode'true);
    define('use_utf8_decode'true); 
    \includes\config.php
    PHP Code:
    $config['Mysqli']['charset'] = 'utf8'
    Last edited by bbtintin; Wed 30th May '12, 8:17pm. Reason: edit code to be clearer

  • #2
    In your ImpExConfig.php file set both of these lines to true:
    Code:
    define('use_utf8_encode', false);
    define('use_utf8_decode', true);
    You shouldn't be changing ImpExFunction.php.

    You may also need to change your charset for the target and the source in the ImpExConfig.php file:
    Code:
    // Advanced Target
    $impexconfig['target']['databasetype']    = 'mysql';    // currently mysql only
    $impexconfig['target']['charset']        = '';
    $impexconfig['target']['persistent']    = false;     // (true/false) use mysql_pconnect
    
    // Advanced Source
    $impexconfig['source']['charset']        = '';
    $impexconfig['source']['persistent']    = false;
    In your config.php make sure you're using the mysqli database class for the best language support. Change:
    Code:
    $config['Database']['dbtype'] = 'mysql';
    To:
    Code:
    $config['Database']['dbtype'] = 'mysqli';
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API - Full / Mobile
    Vote for your favorite feature requests and the bugs you want to see fixed.

    Comment


    • #3
      Thanks Wayne, I will try your way, and keep you posted if any issue.

      Comment


      • #4
        You should also make sure your db stuff matches that the tables in vb have the same default charsets as the phpbb database.

        Comment


        • #5
          Originally posted by Zachery View Post
          You should also make sure your db stuff matches that the tables in vb have the same default charsets as the phpbb database.
          Did you mean the Collation, Zachery?

          @Wayne, I will keep to change in ImExConfig like this:

          Code:
          // Advanced Target 
          $impexconfig['target']['databasetype']    = 'mysql';    // currently mysql only 
          $impexconfig['target']['charset']        = 'utf8'; 
          $impexconfig['target']['persistent']    = false;     // (true/false) use mysql_pconnect 
          
           // Advanced Source 
          $impexconfig['source']['charset']        = 'utf8'; 
          $impexconfig['source']['persistent']    = false;
          For moment, I cannot import because the tool Impex display error 'feader already sent' again, ticket is just submitted please help to fix.
          Last edited by bbtintin; Thu 7th Jun '12, 4:05pm. Reason: [code]

          Comment


          • #6
            I mean in both databases, the collation should be correct. If your phpbb3 database has its tables stored in UTF8, make sure when the vB database is created that its default character collation is set to utf8 as well.

            Comment


            • #7
              Header Already Sent means there is a character before the <?php. If you edit this file in a editor that is capable of UTF-8 and save in an UTF-8 format, you'll get a BOM character which breaks PHP. These characters are not normally visible. The file has to be edited in ASCII format and saved in ASCII format.
              Translations provided by Google.

              Wayne Luke
              The Rabid Badger - a vBulletin Cloud demonstration site.
              vBulletin 5 API - Full / Mobile
              Vote for your favorite feature requests and the bugs you want to see fixed.

              Comment


              • #8
                Originally posted by Wayne Luke View Post
                Header Already Sent means there is a character before the <?php. If you edit this file in a editor that is capable of UTF-8 and save in an UTF-8 format, you'll get a BOM character which breaks PHP. These characters are not normally visible. The file has to be edited in ASCII format and saved in ASCII format.
                Oh, I cannot see it with these tool Notepad++ and window notepad, should I use another tool ?

                - - - Updated - - -

                Originally posted by Zachery View Post
                I mean in both databases, the collation should be correct. If your phpbb3 database has its tables stored in UTF8, make sure when the vB database is created that its default character collation is set to utf8 as well.

                If your phpbb3 database has its tables stored in UTF8

                >> YES, my mphpbb3 has collation: 'utf8_general_ci', while vb has 'latin1_swedish_ci', I have to change it manually in vb after install, as I mentioned earlier in the top.

                make sure when the vB database is created
                >> I install vb in default collation, where can I change collation default to 'utf8_general_ci', I cannot find it in config.php ?

                - - - Updated - - -

                Wayne, regard to the issue 'header already sent', I have already save the file 'Without BOM' as you advise, but it does not work, the issue still there.
                http://screenshotuploader.com/s/01/N1m67fW

                2 file changed: config.php and ImExConfig.php

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X