• 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

Zephyr

Well-known member
#1
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 =>


Etc.
How to avoid this please?

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

Zephyr

Well-known member
#3
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 :/
 

cclaerhout

Well-known member
#4
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
 

Zephyr

Well-known member
#5
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 ?
 

cclaerhout

Well-known member
#7
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 ?
Yes it's good. The purpose is just to debug. What is the charset displayed?
 

cclaerhout

Well-known member
#12
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.
 

Zephyr

Well-known member
#14
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.
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.
 

Jake Bunce

XenForo moderator
Staff member
#16
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.
 

Zephyr

Well-known member
#17
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?
 

Jake Bunce

XenForo moderator
Staff member
#19
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).