UTF-8 Collation. SMF 2.0.19

Started by kitz, July 24, 2024, 08:56:37 AM

Previous topic - Next topic

kitz

As some of you are aware from a previous post, my web hosts recently moved me to new server and I am working my way through a substantially long list of site wide things that have not gone as planned.  I'm hoping that you guys can help me out with the 2 next problems that are related.  Im running 2.019

  • Any posts made before migration that contains certain characters (such as the £ sign or a  ) will now display them as strange symbols. (eg � £ )
  • Members are unable to make posts if they contain certain characters such as the pound £ symbol. Affected posts throw the following errors:
    Incorrect string value: '\xA39.99 ...' for column 'body' at row 1
    File: public_html/forum/Sources/Subs-Post.php Line: 1843

    Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.19, while your database is at version 2.0. The above error might possibly go away if you execute the latest version of upgrade.php.
I briefly mentioned this a couple of weeks ago when the probability of a collation problem was mentioned, but at that time I had a more serious items to fix first. Repair settings has been tried.
At first the data in the database appeared to be mostly latin.  In an attempt to fix the problem my webhosts who'd said it was a bit risky to change the collation on a live database.. created a copy and changed the default char set in the dump file from latin to utf8 and then imported it into a fresh database_2.

In database_2, all tables, & relevant rows are set as utf8. This means that everything past, present and future should be utf8.  If I look at the body of text in the db table row, the chars are displaying correctly.

Ive changed the path in settings.php so that the forum path so it now points to Database_2.  Obviously things wont work correctly yet because SMF is still telling browsers to use the var $smf_charset variable = 'ISO' rather than UTF8.

According to the UTF8 update instructions, iiuc, I need to run the 'convert task' from within the database maintenance tab and install the utf8 language packs. Can someone please help and confirm the following:-

  • From Admin > Languages > Edit Languages
    I need to set something to UTF8. Currently the only option is English ISO-8859-1.  Where can I find the UTF8 language pack compatible with SMF 2.0.19.  I even downloaded the full install but couldnt see anything in there.
  • For the task Admin > Forum Maintenance > Database > Convert the database and data to UTF8.  Checking, will I still need to run this even though the data has already been converted to UTF8. SMF needs to know that the character set is no longer ISO 
  • Hopefully, when SMF uses the correct charset variables to display in the web-browser, it will output the correct symbol and stop members getting error messages if their post or login name/password contains certain symbols

Sir Osis of Liver

The add language feature in 2.0.19 has not worked for some time -

 The Simple Machines site is not responding. Please try again later.

Apparently no one's bothered to fix it.
When in Emor, do as the Snamors.
                              - D. Lister

kitz

I need a UTF8 lang file to be able to upgrade and fix.  atm anyone with certain chars in their username/password cant log in and members cant make posts with chars.
I downloaded a full install and unzipped it to see if there was one in there, but there wasnt. :(

Arantor

Holder of controversial views, all of which my own.


kitz

Quote from: Arantor on July 25, 2024, 01:56:31 AMEnglish UTF-8 - https://download.simplemachines.org/index.php?languages;id=1

Thank you, that seems to have fixed it.
FTR. I didnt need to run the utf8 converter. SMF added utf-8 as an option as soon as I manually uploaded the language files in that zip.

Sir Osis of Liver

Why doesn't the admin link work?
When in Emor, do as the Snamors.
                              - D. Lister

Advertisement: