Topic: db_update.php

Hello

I have problem with my DB conversion. Existing DB is in ISO-8859-2 (latin-2 / Polish) coding, but has many UTF-8 chars stored as &#xxxx; (like € = €)

I'm loosing those chars after conversion, and geting "?" in its place.

One more thing. Conversion is not changing collate parameter in tables. So after it I have utf8_general_ci tables with latin2_general_ci fields. I found out, that leaving this, unabling you to add special chars like € (for example to Forum Rules).

Can you give me any clue how to sort it out? roll





What did I try? :

- move conv_tables stage to begin
- creating new stage "pre_start" with changing all latin2_general_ci collatings to utf_general_ci (which is not working at all ??)

function pre_convert_table_utf8($table)
{
    global $forum_db;

    $result = $forum_db->query('SHOW FULL COLUMNS FROM `'.$table.'`') or error(__FILE__, __LINE__);
    while ($cur_column = $forum_db->fetch_assoc($result))
        if ($cur_column['Collation'] && $cur_column['Collation'] !== 'utf8_general_ci')
        {
            $allow_null = ($cur_column['Null'] == 'YES');
            $forum_db->alter_field($table, $cur_column['Field'], $cur_column['Type'].' CHARACTER SET utf8 COLLATE utf8_general_ci', $allow_null, $cur_column['Default']);
        }
}

- changing collate manualy before conversion

YonasH's repository + Extensions Directory = PunBB Extensions Online Library (in progress....)

Away. I will be back soon.

Re: db_update.php

Nobody? sad

Today I'll try to add temporary utf-8 field, copy content from message field, and work on this copy... I'll see.

But I'm still wondering why my pre_convert_table_utf8 function is not working. Any ideas?

YonasH's repository + Extensions Directory = PunBB Extensions Online Library (in progress....)

Away. I will be back soon.

Re: db_update.php

Still nothing
The problem is ONLY with special chars like "€". National chars are converted ok.

Now I'll try:
1. disable dcr2utf8 function, leaving those chars as &#xxxx;
2. After conversion change collate to utf
3. Apply dcr2utf8 fuction

YonasH's repository + Extensions Directory = PunBB Extensions Online Library (in progress....)

Away. I will be back soon.

4 (edited by YonasH 2008-12-22 23:37)

Re: db_update.php

It finaly worked after:
1. manualy changed posts and users table collation to utf8_general_ci
2. manualy changed fileds collation in these tables to utf8_general_ci
3. run unchanged db_update
4. manualy changed rest of fields collations to utf8_general_ci

do anyone else have similar problem? If yes, then I'll prepare some modified db_update file. just let me know thru PM

YonasH's repository + Extensions Directory = PunBB Extensions Online Library (in progress....)

Away. I will be back soon.