Loading...
 
Skip to main content

History: Encode fix verification

Source of version: 5 (current)

Copy to clipboard
            {syntax type="markdown"  editor="wysiwyg"} # Encoding Fix Verification

Because changes to your Tiki database encoding can be confusing and difficult to troubleshoot problems it's best to do a few quick verification, after you have applied the three steps of the upgrade process to "fix the encoding issue" (if needed, see [https://doc.tiki.org/Upgrade#Fix_the_encoding_issue]) .


##$ Verify local.php 
This file stores the Tiki database connection information

1. Open <Tiki Install Location>/db/local.php with your favorite text editor (vi, emacs, etc...)
2. Verify client_charset is set to utf8
3. update manually if incorrect



##$ Verify Database 
The database and its tables should have been updated to use the utf8 character set. Verifying the database involves querying the "information_schema" which is essentially the data dictionary for MySQL. So log in to MySQL using the Tiki schema (database) owner account to execute these queries.


###$ Schema verification 
This simple select lists characteristics for the database itself. 
{CODE(caption="Schema Verification SQL",wrap="0")}select * from information_schema.schemata;{CODE}

1. Run the SQL
2. Verify the "DEFAULT_CHARACTER_SET_NAME" for the Tiki schema is set to "utf8" and that "DEFAULT_COLLATION_NAME" is set to "utf8_general_ci"
3. If these values are not as specified, run the below SQL:

{CODE(caption="Schema Correction SQL",wrap="0")}
ALTER DATABASE {Tiki db_name}
    DEFAULT CHARACTER SET 'utf8'
    DEFAULT COLLATE 'utf8_general_ci';
{CODE}


###$ Table verification 
This simple select lists key characteristics for each table of the Tiki DB. 
{CODE(caption="Table Verification SQL",wrap="0")}select table_name, table_collation from information_schema.tables where table_schema = '{Tiki db_name}';{CODE}

1. Run the SQL
2. Verify "table_collation" is set to "utf_general_ci"
3. Run the below SQL for each table not set correctly

{CODE(caption="Table Correction SQL",wrap="0")}
ALTER TABLE {Tiki db_name}.{Table Name}
    CONVERT TO CHARACTER SET 'utf8' COLLATE 'utf8_general_ci'
    DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
{CODE}

###$ Content verification 
You need to be sure that the content in your database has been converted to utf-8. If you had non as-cii characters in your wiki pages, it's very easy to verify if you had your db tables content converted to utf-8 or not.

If you see weird characters instead of non-ascii characters like accents, tilde, apostrophes, etc, then your content is not in utf-8. In this case, you can apply the fix from the installer in the last step.

Check [https://doc.tiki.org/Upgrade#Fix_the_encoding_issue] .

If you were using plain English in your wiki pages, then ask for help in the ((tw:Irc)) channel, for instance.