Hello,
I have just noticed that my Hungarian characters are stored incorrectly in the db. Even though they are displayed back right, and the db collation is UTF, and the character encoding as well.
I believe it has to do with the mysql connection, and I had a similar issue with phpbb.
I had to add the following lines added to mysql php right after
if( $this->db_connect_id )
{
$result = mysql_query('SET character_set_client = utf8') or die('Query failed: ' . mysql_error());
$result = mysql_query('SET character_set_results = utf8') or die('Query failed: ' . mysql_error());
$result = mysql_query('SET character_set_connection = utf8') or die('Query failed: ' . mysql_error());
Is there a similar db connection file for coppermine?
You can add that into cpg_db_connect in include/functions.inc.php but you really shouldn't need to.
Yeah, that is what I was hoping for, but when I check the db, I see such stuff:
Szakáll shows as Szakáll in the db
Lépcső shows as lépcsÅ' in the db
The special characters like ő, á, é, í all look ugly...
Even though they look right on the output, I would like to get them right everywhere....Will try to add that stuff in the db, and will let you know how it went :)
What are you checking using? Is that set to display unicode?
I use phpmyadmin
the same characters display fine in my phpbb_users table, where I can see them for usernames...but in coppermine_pictures keywords and such, I see the garbage characters.
I think the issue lies maybe at the connection or client charset, UTF8 has to be set maybe at 6-8 places :o
Yeah it worked for me!
I added this code
$utf = mysql_query('SET character_set_client = utf8') or die('Query failed: ' . mysql_error());
$utf = mysql_query('SET character_set_results = utf8') or die('Query failed: ' . mysql_error());
$utf = mysql_query('SET character_set_connection = utf8') or die('Query failed: ' . mysql_error());
Right after:
function cpg_db_connect()
{
global $CONFIG;
$result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
Although I do not recommend this to those that have a lot of picture with garbage chars, as this will make the pages display exactly what is in the db...
I am glad I could contribute my two pence for coppermine.
Cheers,
Gyuri
One last thing, for this to work, I had to alter the collation of the tables AND the columns as well to utf8_general_ci
Cheers,
Gyuri