News:

Wondering if this will always be free?  See why free is better.

Main Menu

Convert to UTF-8?

Started by Petter B, March 07, 2017, 03:14:34 AM

Previous topic - Next topic

Petter B


It the conversion worked, the Collation in all tables would be UTF-8, right?

In attached, only half of them are. When i look at the values, in tables w UFF-8 all å,ä,ö are replaced by stuff like ÃÆ'Ã,¤r
In tables that are latin1_swedish_ci the text is all cut of from the letter ä,å,ö.

In the forum admin , there is no longer an option to convert database to UTF-8, only to convert HTLM-enteties.

Still, if only half the database was converted, no-one of the halfs work...

shawnb61

It might be worth trying a different approach... 

Since none of your data is corrupted, you may try simply changing the collation for each table to UTF8-general-ci in phpMyAdmin.  No bit-twiddling needed...  I would TEST that & see if it works. 

I was in a worse situation: prior admins attempted UTF8 conversions (multiple fails, I don't know the details) and gave up.  When I was asked to step in, the SMF tables utilized 2 charsets and 7 collations...   :o

The only good news was that since they could never get multi-language support to work, everything was still English & no content was corrupted.  Other than "english only", the issues were invisible to users. 

Modeled after some info I found online, I wrote a simple php script that issued the ALTER TABLEs to set collations & charsets consistently across all of SMF.  This is basically the equivalent to changing the collation for each table above (just quicker & easier).  If interested, I'll share it with you, if you promise to test it adequately beforehand.  Worked for me, & got rid of a slew of collation errors in my error log.  It also allowed us to finally provide multi-language support after years of failed attempts.  If interested, PM me with contact info. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Petter B

Today I tried with a fresh copy of my original database, but ran in to same problem as earlier:
QuoteDuplicate entry 'vår-4328' for key 'PRIMARY'
Fil: /home/d/dev/www/Sources/ManageMaintenance.php
Rad: 705
NOTE: It appears that your database may need to be upgraded. Your forum files belonging to the SMF version 2.0.13, while your database belong to version 2.0.2. It is very possible that this error can be resolved if you're running the latest version of Upgrade.php.

Thanks for your suggestion, but I think it´s above my level of skill. I will just have to hire someone for this.
Or skip it.

shawnb61

Petter -

Do you have a search index built?  If so, is it the 'full text' or the 'custom' index?

I'm still looking into this....   
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

qubbah

Quote from: shawnb61 on March 15, 2017, 05:32:15 PM
It might be worth trying a different approach... 

Since none of your data is corrupted, you may try simply changing the collation for each table to UTF8-general-ci in phpMyAdmin.  No bit-twiddling needed...  I would TEST that & see if it works. 

I was in a worse situation: prior admins attempted UTF8 conversions (multiple fails, I don't know the details) and gave up.  When I was asked to step in, the SMF tables utilized 2 charsets and 7 collations...   :o

The only good news was that since they could never get multi-language support to work, everything was still English & no content was corrupted.  Other than "english only", the issues were invisible to users. 

Modeled after some info I found online, I wrote a simple php script that issued the ALTER TABLEs to set collations & charsets consistently across all of SMF.  This is basically the equivalent to changing the collation for each table above (just quicker & easier).  If interested, I'll share it with you, if you promise to test it adequately beforehand.  Worked for me, & got rid of a slew of collation errors in my error log.  It also allowed us to finally provide multi-language support after years of failed attempts.  If interested, PM me with contact info. 

What is that code? tq

Advertisement: