forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: mitko on July 17, 2016, 08:17:22 pm

Title: Problem with specific symbol in unicode
Post by: mitko on July 17, 2016, 08:17:22 pm
Gents, recently i got a report from one of the users:
---
in Norwegian and other Scandinavian Languages there are a few letters more, like Ć, Ĺ, etc.
all this I can use for the name, but not the capital letter "Ř" ... ALT0216 ...
when I use it, it appears a question mark and a rhombus, which not looks good.
instad of I am now using the German letter "Ö", wich works.
both letter Ö and Ř have the same sound, it is a bit like the Russian "Ё" ... not exactly, but similar ...
---
I checked, the problem is really exist. Also i checked MySQL (db is utf8_general_ci) and Coppermine properties (utf8 in config).
What else i should check? 
Title: Re: Problem with specific symbol in unicode
Post by: Αndré on July 17, 2016, 11:05:15 pm
all this I can use for the name

What exactly is meant with "name"? The file name? Or some meta data like title, description, etc.?
Title: Re: Problem with specific symbol in unicode
Post by: mitko on July 18, 2016, 07:20:31 pm
Title, description, any text field
Title: Re: Problem with specific symbol in unicode
Post by: Αndré on July 18, 2016, 08:27:28 pm
Works as expected in my testbed. Please try to add
Code: [Select]
$CONFIG['dbcharset'] = 'utf8';to include/config.inc.php. This will probably break all existing text fields, but I'd like to know if it works as expected for new text (title, description, comment, ...).
Title: Re: Problem with specific symbol in unicode
Post by: mitko on July 18, 2016, 08:56:22 pm
You're right, Andre, $CONFIG['dbcharset'] = 'utf8'; fixes the problem for new text but brokes for old.
Title: Re: Problem with specific symbol in unicode
Post by: Αndré on July 18, 2016, 09:13:17 pm
You need to convert the data in your database to utf8 to fix the issue for old and new data. Unfortunately I'm no expert for such stuff. Some of our (dev team) members are more experienced in such things, maybe someone replies to this thread. Feel free to search our board for similar threads, there are some (in some cases quite long) threads which fixed the issue for the user.
Title: Re: Problem with specific symbol in unicode
Post by: mitko on July 19, 2016, 08:12:04 pm
I checked the server configuration
Code: [Select]
character_set_client utf8mb4
character_set_connection utf8mb4
character_set_database latin1
character_set_filesystem binary
character_set_results utf8mb4
character_set_server latin1
character_set_system utf8
collation_connection utf8mb4_unicode_ci
collation_database utf8_general_ci
collation_server latin1_swedish_ci

I tried to use
Code: [Select]
ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_general_ci;but see strange behaviour: character_set_database becames utf8 for several minutes but then drops back to latin1
Title: Re: Problem with specific symbol in unicode
Post by: Αndré on July 19, 2016, 08:25:42 pm
Probably your host can answer that question.
Title: Re: Problem with specific symbol in unicode
Post by: mitko on July 19, 2016, 09:45:24 pm
OK now i have following
character_set_client utf8mb4
character_set_connection utf8mb4
character_set_database utf8
character_set_filesystem binary
character_set_results utf8mb4
character_set_server latin1
character_set_system utf8
collation_connection utf8mb4_unicode_ci
collation_database utf8_general_ci
collation_server latin1_swedish_ci
Two questions:
1. Problem still exist
2. Could be parameters highlighted by bold be a reason?
Title: Re: Problem with specific symbol in unicode
Post by: Αndré on July 20, 2016, 09:25:03 am
Could be parameters highlighted by bold be a reason?

character_set_server latin1 - maybe
collation_server latin1_swedish_ci - no

I also don't know if changing "character_set_server" will fix your issue at all. Have you tested that? From what I remember you need to run one or more SQL queries to convert the encoding of the data already stored in your database. If I have some spare time, I'll try to find the thread where this has been fixed for another user.