coppermine-gallery.com/forum

Support => cpg1.6.x Support => cpg1.6 language => Topic started by: phil1011 on August 05, 2024, 08:40:45 AM

Title: Japanese text now gibberish after MySQL 8.0 upgrade
Post by: phil1011 on August 05, 2024, 08:40:45 AM
Hello,

I'm running version 1.6.07.

After my web host upgraded to MySQL 8.0 (from MySQL 5.7), my site's Japanese text has become gibberish.

How can I fix this?

My web host's support gave me this message:

"The issue you are running into is that the older versions of MySQL
used "latin1" character set and "latin1_swedish_ci" collation as the
server defaults. The new versions of MYSQL now use 'utf8mb4' character set
and usually "utf8mb4_0900_ai_ci" as the collation. Your content was encoded
under latin and swedish terms, but is now being served or read as if it was
utf8mb4 encoded.

We are not overly familiar with Coppermine Photo Gallery, but many
users that have seen similar issues with other software packages have been
able to correct their issues by setting their software to expect or use the
"latin1" character set, without making any changes to the database itself.
I am not certain if this is a setting available in Coppermine though."

Thanks for any advice.
Title: Re: Japanese text now gibberish after MySQL 8.0 upgrade
Post by: ron4mac on August 05, 2024, 01:33:56 PM
Add this line:
$CONFIG['dbcharset'] = 'latin1';
to the bottom of your include/config.inc.php file.
Title: Re: Japanese text now gibberish after MySQL 8.0 upgrade
Post by: phil1011 on August 05, 2024, 02:34:36 PM
Thank you so much ron4mac! It worked!