Advertisement:

Author Topic: Convert to UTF-8?  (Read 3287 times)

Offline Petter B

  • Semi-Newbie
  • *
  • Posts: 85
Re: Convert to UTF-8?
« Reply #20 on: March 15, 2017, 12:07:59 PM »

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

Offline shawnb61

  • Support Specialist
  • Full Member
  • *
  • Posts: 452
    • sbulen on GitHub
Re: Convert to UTF-8?
« Reply #21 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. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Petter B

  • Semi-Newbie
  • *
  • Posts: 85
Re: Convert to UTF-8?
« Reply #22 on: March 16, 2017, 12:18:48 PM »
Today I tried with a fresh copy of my original database, but ran in to same problem as earlier:
Quote
Duplicate 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.

Offline shawnb61

  • Support Specialist
  • Full Member
  • *
  • Posts: 452
    • sbulen on GitHub
Re: Convert to UTF-8?
« Reply #23 on: March 19, 2017, 07:12:37 PM »
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

Offline qubbah

  • Full Member
  • ***
  • Posts: 558
Re: Convert to UTF-8?
« Reply #24 on: March 20, 2017, 12:43:47 AM »
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