Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: utf 8  (Read 8070 times)

0 Members and 1 Guest are viewing this topic.

frank61

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
utf 8
« on: October 10, 2010, 06:06:58 PM »

Hello,

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

Code: [Select]
   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

Code: [Select]
mysql_query("SET NAMES 'utf8'",$result);


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

Code: [Select]
   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

« Last Edit: April 05, 2011, 03:12:45 PM by Αndré »
Logged

Nibbler

  • Guest
Re: utfs 8
« Reply #1 on: October 10, 2010, 10:34:41 PM »

You are misunderstanding the feature. You use this by adding

Code: [Select]
$CONFIG['dbcharset'] = 'utf8';

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

frank61

  • Coppermine newbie
  • Offline Offline
  • Posts: 19
Re: utfs 8
« Reply #2 on: October 11, 2010, 04:14:10 PM »

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
Logged

saunje

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
utf 8
« Reply #3 on: April 02, 2011, 09:19:45 PM »

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

Code: [Select]
   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

Code: [Select]
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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: utf 8
« Reply #4 on: April 05, 2011, 03:14:37 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).
Logged

HNorbert

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: utf 8
« Reply #5 on: July 17, 2011, 01:16:18 PM »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.068 seconds with 20 queries.