Simple Machines Community Forum

SMF Support => Converting to SMF => YaBB/YaBB SE => Topic started by: Black_ICE on December 05, 2010, 02:03:14 PM

Title: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: Black_ICE on December 05, 2010, 02:03:14 PM
Hello!

I am trying to convert from Yabb 2.1 to SMF 1.1.12. I downloaded converter files, started conversion. When choosing UTF8 everything is cut off.

When choosing iso-8859-1 in the converter page, some forum entries are there completely and others are cut off.

I compared in Yabb two text files to see if they are coded different. But both are in iso-8859-1. One is not cut off (there is an ö) and other is cut off, where is an ö.

any clues?
Title: Re: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: ThorstenE on December 12, 2010, 01:14:53 AM
I'd recommend to install SMF in iso-8859-1 / latin and choose latin1 as character set at the start of convert.php.
Title: Re: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: Black_ICE on December 18, 2010, 02:58:11 PM
Ok, I have installed SMF again with iso8859-1 encoding. The database has a standard encoding of latin1_german_ci.

When converting, I get this error:

Converting polls and poll choices (part 1)... Unsuccessful!
This query:

    SELECT ID_MEMBER, realName
    FROM `nur_ruhe_smf`.smf_members
    WHERE realName IN ("Wörterbuch(Guest)");

Caused the error:

    Illegal mix of collations (latin1_german1_ci,IMPLICIT) and (utf8_unicode_ci,COERCIBLE) for operation '='

so what is wrong?
Title: Re: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: ThorstenE on December 19, 2010, 01:43:58 AM
can you please check the table smf_members, especially the field realName? I believe the collation of that field is utf8_unicode_ci and this is the problem..
Title: Re: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: Black_ICE on December 20, 2010, 05:27:00 AM
It says everywhere latin1_german_ci

can it be, that the converter sets the connection to mysql specifically to UTF8? because when I enter the SQL Statement in phpMyAdmin it works without error.
Title: Re: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: ThorstenE on December 20, 2010, 11:59:44 AM
maybe, please edit convert.php and find:
mysql_query("SET NAMES $charset");
replace it with
mysql_query("SET NAMES latin1_german_ci");
Title: Re: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: Black_ICE on December 20, 2010, 01:11:48 PM
This did not make any difference. Same error message keeps coming. I also noticed that when importing, the Umlaut were imported as ? (questionmark). so können look like k?nnen. So setting everything to latin1 did not make it better.

Please note that this is an Opensuse 11.3 installation. Mysql is 5.1.46 and Apache is 2.2.15.
Title: Re: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12
Post by: Black_ICE on December 21, 2010, 07:17:53 AM
I solved the problem by installing smf new, setting everything to UTF8. Also made sure, that the tables are in UTF8.

Then I changed the converter as follows:

in yabb21_to_smf.php I added this function:



    function utf8encodeArray ($anarray)
    {
        foreach ($anarray as $bkey => $bvalue)
        {
            if (is_array($bvalue))
            {
                $anarray[$bkey] = utf8encodeArray($bvalue);
            }
            else
            {
                $anarray[$bkey] = utf8_encode($bvalue);
            }
        }
        return $anarray;
    }


and in the function doBlock I added following line just after if (empty $block)) return;

$block = utf8encodeArray($block);

When importing I also choose UTF8 as default. This made it to import everything correct.