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

XF 1.1 Ipboard => Xenforo

Discussion in 'Installation, Upgrade, and Import Support' started by Zephyr, Sep 29, 2012.

  1. Zephyr

    Zephyr Well-Known Member

    Hello, I have a problem when converting to ipboard to XenForo.

    Accented characters are not displayed (title, topic, message, user, etc.) :

    élémentaire => lmentaire
    bric-à-brac=> bric--bra

    Présentation des membres =>
    [​IMG]

    Etc.
    How to avoid this please?

    I opened a ticket, but XenForo must be closed the weekend.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I am looking at this now. I can confirm the problem but I'm not sure how to fix it. I'm trying to get Mike to take a look.
     
    Jarod likes this.
  3. Zephyr

    Zephyr Well-Known Member

    Ok thank you.
    As for now, I just do not use XenForo and I need for my future projects XenForo.

    You arrive to find a solution to the problem in all cases please ?
    I can not abandon this project, I have several months of work on it and a big community waiting for the conversion for several days :/
     
  4. cclaerhout

    cclaerhout Well-Known Member

    You should check this part of the code \library\XenForo\Importer\IPBoard.php:

    Code:
            if (!$errors)
            {
                $defaultCharset = $db->fetchOne("
                    SELECT IF(conf_value = '' OR conf_value IS NULL, conf_default, conf_value)
                    FROM {$config['db']['prefix']}core_sys_conf_settings
                    WHERE conf_key = 'gb_char_set'
                ");
                if (!$defaultCharset || str_replace('-', '', strtolower($defaultCharset)) == 'iso88591')
                {
                    $config['charset'] = 'windows-1252';
                }
                else
                {
                    $config['charset'] = strtolower($defaultCharset);
                }
            }
    
    I'm not sure the conditional is valid (SELECT IF shouldn't it be SELECT IFF )
    First check the charset used, you can put after above code
    Code:
    $errors[] = $config['charset'];
    
    For French, it should be windows-1252
     
  5. Zephyr

    Zephyr Well-Known Member

    Thank for your help :)

    BDD => http://puu.sh/1a1OH.jpg
    Xenforo => http://puu.sh/1a1NS.jpg
    IPBoard => http://puu.sh/1a1Ol.jpg

    I have:
    Code:
            if (!$errors)
            {
                $defaultCharset = $db->fetchOne("
                    SELECT IF(conf_value = '' OR conf_value IS NULL, conf_default, conf_value)
                    FROM {$config['db']['prefix']}core_sys_conf_settings
                    WHERE conf_key = 'gb_char_set'
                ");
                if (!$defaultCharset || str_replace('-', '', strtolower($defaultCharset)) == 'iso88591')
                {
                    $config['charset'] = 'windows-1252';
                }
                else
                {
                    $config['charset'] = strtolower($defaultCharset);
                }
            }
    
                  // I add your code :
                  errors[] = $config['charset'];
    
            return $errors;
        }
    
    It's good ?
     
  6. Insy

    Insy Well-Known Member

    Should rather be:
    Code:
    $errors[] = $config['charset'];
    
    ;)
     
    cclaerhout likes this.
  7. cclaerhout

    cclaerhout Well-Known Member

    Yes it's good. The purpose is just to debug. What is the charset displayed?
     
  8. Zephyr

    Zephyr Well-Known Member

  9. cclaerhout

    cclaerhout Well-Known Member

    The charset is the good one... No problem here. Sorry.
     
  10. Zephyr

    Zephyr Well-Known Member

    The problem would be where ? :S
     
  11. Insy

    Insy Well-Known Member

    XenForo offers a paid Installation service. Perhaps they would be able to migrate your database if you ask them?
    I recommend you to contact the support again.
     
  12. cclaerhout

    cclaerhout Well-Known Member

    May be try to change:
    Code:
            $this->_sourceDb = Zend_Db::factory('mysqli',
                array(
                    'host' => $config['db']['host'],
                    'port' => $config['db']['port'],
                    'username' => $config['db']['username'],
                    'password' => $config['db']['password'],
                    'dbname' => $config['db']['dbname']
                )
            );
    
    to
    Code:
            $this->_sourceDb = Zend_Db::factory('mysqli',
                array(
                    'host' => $config['db']['host'],
                    'port' => $config['db']['port'],
                    'username' => $config['db']['username'],
                    'password' => $config['db']['password'],
                    'dbname' => $config['db']['dbname'],
                    'charset' => 'utf8'
                )
            );
    
    It's one of the difference with the phpbb importer.
     
  13. Zephyr

    Zephyr Well-Known Member

    It changes nothing, no error and accented characters are not there :/

    [​IMG]
    ...also does not change.
     
  14. Zephyr

    Zephyr Well-Known Member

    Done, but I'm not paying while I just buy XenForo 175$, it's a technical bug of xenforo code if my database is ok.
    And everything seems to be good on my side.

    In short, the support is included in the price and I hope that this problem will be solved because at the moment I can not use XenForo if I can not import my community.
     
  15. Insy

    Insy Well-Known Member

    Sure. Nevertheless, you should contact the support again.
    This does not solve his problem.
     
  16. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You know what's weird. This script omits the accented 'e' in the output:

    Code:
    <?phpinfo
    
    $string = 'Règles du forum';
    
    echo 'normal: ' . $string . '<br />';
    
    I'm afraid I don't know much about character encoding stuff, and Google isn't turning up anything useful in this case. I have played with the code but no solution is forthcoming.
     
  17. Zephyr

    Zephyr Well-Known Member

    If I spend my database ipboard.sql, you can try to change things other than utf8 to try to get at least the strange characters that I could replace manually with a script?
     
  18. cclaerhout

    cclaerhout Well-Known Member

    Ok, is there a field in IPB control panel where the charset can be configured?

    Your problem is that your content is marked as utf-8, but it's not. I've made a test file to help you to understand.
     

    Attached Files:

    Jake Bunce likes this.
  19. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    In reference to this code from the IPB importer:

    library/XenForo/Importer/IPBoard.php

    Code:
    		if (!$errors)
    		{
    			$defaultCharset = $db->fetchOne("
    				SELECT IF(conf_value = '' OR conf_value IS NULL, conf_default, conf_value)
    				FROM {$config['db']['prefix']}core_sys_conf_settings
    				WHERE conf_key = 'gb_char_set'
    			");
    			if (!$defaultCharset || str_replace('-', '', strtolower($defaultCharset)) == 'iso88591')
    			{
    				$config['charset'] = 'windows-1252';
    			}
    			else
    			{
    				$config['charset'] = strtolower($defaultCharset);
    			}
    		}
    
    In Zephyr's case the IPB database has no conf_value defined so it's using the conf_default which is UTF-8 in his database. If the data is not UTF-8 then that's a problem as cclaerhout said.

    I am going to suggest that you replace the above code with this:

    Code:
    		if (!$errors)
    		{
    			$config['charset'] = 'windows-1252';
    		}
    
    That will force a source encoding of windows-1252 to correct what appears to be a misreported encoding in your IPB database. That may fix your problem (after you run the import again).
     
    cclaerhout likes this.
  20. Zephyr

    Zephyr Well-Known Member

    Hello, this is much better now ! :)

    [​IMG]

    but:

    [​IMG]

    ======>

    [​IMG]

    ==> Page 2 ;)
     
    Jake Bunce likes this.

Share This Page