utf 8 utf 8
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

utf 8

Started by frank61, October 10, 2010, 06:06:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

frank61

Hello,

I upgraded CPG to 1.5.8 and I saw new rows in the functions.inc.php at about a row 184:


   if ($CONFIG['dbcharset']) {
       mysql_query("SET NAMES '{$CONFIG['dbcharset']}'", $result);


It doesn't work, still i need to add one row as in the 1.5.6 and 1.4.x I did


mysql_query("SET NAMES 'utf8'",$result);


My functions.inc.php about row 184 looks like that:


   if ($CONFIG['dbcharset']) {
       mysql_query("SET NAMES '{$CONFIG['dbcharset']}'", $result);
   }
mysql_query("SET NAMES 'utf8'",$result);
   return $result;
}


In the config I have language code Unicode UTF 8 selected, and also in the database is inserted.
If I don't insert that raw, encoding is not UTF 8.
That is just a note about that rows, maybe It is helpful.

www.photoportal.sk
Frank


Nibbler

You are misunderstanding the feature. You use this by adding


$CONFIG['dbcharset'] = 'utf8';


into include/config.inc.php. This way you don't need to modify a core file.

frank61

You are right, It works as I need,
I get the functions.inc.php back to original version 1.5.8

I read about that prvevious changing UTF 8 encoding somewhere in the forum,
but this user settings in the config.inc.php is better one for the next CPG version.
Thank You for advice,

www.photoportal.sk
Frank

saunje

Good day,

Thank you for good gallery software.

I had problems with unicode comments and captions of pictures. I set the gallery encoding parameter to utf8 but all characters in database were wrong encoded.

My gallery database encoding is correct and it is utf8.
my gallery core includes the unicode parameter setting lines


   if ($CONFIG['dbcharset']) {
        mysql_query("SET NAMES '{$CONFIG['dbcharset']}'", $result);
    }


but it is not enough!
I have to add the following lines in order to make my gallery work with unicode properly


mysql_query('SET NAMES utf8 COLLATE utf8_general_ci', $result);
mysql_query("SET CHARACTER SET 'utf8'", $result);


in the other words, collation and character set settings are important as well as the encoding parameter.
Is my solution good or it is better one?

As this issue is common for all the users with non English gallery owners, please correct the caption of this topic to utf 8 (now it is utfs 8) in order to make them easy to find it.

Αndré

Quote from: saunje on April 02, 2011, 09:19:45 PM
please correct the caption of this topic to utf 8 (now it is utfs 8) in order to make them easy to find it.
Done as suggested.

Maybe you also need to set the character set, but the collation only affects the default order (which may be important while running your gallery, but doesn't affect the encoding of your characters).

HNorbert

Hello!

I'm not quite sure, that it's the best place for my question in this case, please forgive me. So, i have problems with hungarian characters, e.g. á, é, ő, ó...., they are replaced with ?? . I've searched for many hours, but I found no solution. The problem only occurs in the names of the albums, and the title and subtitle of the gallery.

The MySQL is set to latin-2 (originally it was utf-8, but no difference), and the gallery is set to utf-8. The hungarian translation works well, can use the special characters.

Thanks for your assistance