Charset/Encoding problem after update OJS for recent versions

Hello guys, how are you? I need some help on OJS. I’ve updated the OJS (after a lot of errors and problems) but I’m having troubles with the charset/encoding. Strange characters, the same of a lot of people, like this: “ê á êà Ô

My config.ing.php:

; Default locale
locale = en_US

; Client output/input character set
client_charset = utf-8

; Database connection character set
; Must be set to “Off” if not supported by the database server
; If enabled, must be the same character set as “client_charset”
; (although the actual name may differ slightly depending on the server)
connection_charset = utf8

; Database collation
collation = utf8_unicode_ci

imagem_2020-12-09_101948

But it looks like the problem is in the Database, the db and all collations are utf8_unicode_ci.

I tried connection_charset = Off/On/utf-8 and utf8.
I tried all database collation in config.inc.php possible, On/Off/utf8/utf-8/ utf8_general_ci/utf8_unicode_ci.
I tried change all the db for utf8_bin and utf8_general_ci.
I’ve updated for 3.2.1-2, 3.2.1-1 and 3.2.0-3 but the problem persist, that’s why I think the problem it’s in my db.
I tried in Softaculous app too.
I tried all solutions in this forum and forums in my language.

I don’t know more what to do, the company needs this update and I need solve this problem.

I hope someone can help me, thank you.

Hi @PedroMuniz,

I don’t remember any config named collation. There was database_charset, which was removed starting from OJS 3.2.0.
What are the charset set and collation of the database?

Hello Vitaliy

Database Collation are in line 140 from config.inc.php of 3.2.1-2 version.

All the database are in utf8_unicode_ci.

You are right. My bad.

This is the collation, and what about the character set? MySQL :: MySQL 8.0 Reference Manual :: 10.3.3 Database Character Set and Collation (3rd example)

imagem_2020-12-10_121724

Looks like your configuration is OK, probably the data itself is in a wrong encoding. You can try restore the database from a dump, and if is not corrupted there, upgrade once again.

I tried many many times on sandbox and on my server but didn’t work.

There’s something more I can try?

Have you tried with the backup that was made before the upgrade (after which the problem occurred)?

Yes, a lot of times.

Thanks for your help.

Hmm, the configuration looks OK to me but if data was already misencoded it should be converted back to the proper encoding. There is a related topic: Charset encode confusion - #4 by asmecher as well as similar threads on this forum.