Advertisement:

Author Topic: some text are cut off where is Umlaut (öäü or ß) - Yabb 2.1 to SMF 1.1.12  (Read 18529 times)

Offline Black_ICE

  • Newbie
  • *
  • Posts: 5
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?

ThorstenE

  • Guest
I'd recommend to install SMF in iso-8859-1 / latin and choose latin1 as character set at the start of convert.php.

Offline Black_ICE

  • Newbie
  • *
  • Posts: 5
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?

ThorstenE

  • Guest
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..

Offline Black_ICE

  • Newbie
  • *
  • Posts: 5
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.

ThorstenE

  • Guest
maybe, please edit convert.php and find:
Code: [Select]
mysql_query("SET NAMES $charset");replace it with
Code: [Select]
mysql_query("SET NAMES latin1_german_ci");

Offline Black_ICE

  • Newbie
  • *
  • Posts: 5
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.

Offline Black_ICE

  • Newbie
  • *
  • Posts: 5
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:


Code: [Select]
    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;

Code: [Select]
$block = utf8encodeArray($block);
When importing I also choose UTF8 as default. This made it to import everything correct.