algerd
September 11, 2019, 6:29am
1
Cyrillic text on my website looks like:
������������
my databse:
|character_set_client|utf8mb4|
|character_set_connection|utf8mb4|
|character_set_database|cp1251|
|character_set_filesystem|binary|
|character_set_results|utf8mb4|
|character_set_server|cp1251|
|character_set_system|utf8|
|character_sets_dir|/usr/share/percona-server/charsets/|
|collation_connection|utf8mb4_unicode_ci|
|collation_database|cp1251_ukrainian_ci|
|collation_server|cp1251_ukrainian_ci|
OJS 3.1.2-1
How to fix it?
What are the values of the charset settings in config.inc.php?
; 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 = Off
; Database storage character set
; Must be set to "Off" if not supported by the database server
database_charset = Off
Is this an upgrade of an existing OJS installation? If so, be sure the new configuration settings match the former settings.
algerd
September 24, 2019, 8:42am
3
We had problems in our database. We were able repaire the database.
Now we have migrate to new hosting.
my database now:
character_set_client utf8
character_set_connection utf8
character_set_database cp1251
character_set_filesystem binary
character_set_results utf8
character_set_server cp1251
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/
collation_connection utf8_general_ci
collation_database cp1251_general_ci
collation_server cp1251_general_ci
In my config.inc.php:
client_charset = utf-8
connection_charset = Off
database_charset = Off
charset_normalization = Off
If I add to /ib/pkp/classes/db/DBConnection.inc.php string
$this->dbconn->Execute(“set names ‘utf8’”);
then site look correct.
Can I change config.inc.php without changing Connection.inc.php?
What should be the values in config.inc.php?
I think this would be the equivalent of:
connection_charset = utf8
https://dev.mysql.com/doc/refman/8.0/en/set-names.html
In 3.x only client_charset
and connection_charset
remain in config.inc.php:
; 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 = Off
The expectation is that this would generally match the values originally in your 2.x config.inc.php.