After upgrading from 1.4.x, non-ascii characters don't show properly After upgrading from 1.4.x, non-ascii characters don't show properly
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

After upgrading from 1.4.x, non-ascii characters don't show properly

Started by whitewash, September 06, 2010, 03:49:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

whitewash

Hello,

I did the upgrade from 1.4 branch to version 1.5.8. I've deleted everything except albums/, uploaded content of 1.5.8 archive, restored backed-up include/config.inc.php and ran update.php... everything worked just fine,
except that now names of albums,categories and everthing else, which is stored in the database, display incorrectly. All language-specific chars. are not showing properly, only the ? sign shows instead. Strings stored in language files (such as translations of buttons etc...) show fine.

All database tables' charsets and collations are set to utf8, Coppermine charset is set to utf8, the 1.4.x version was also utf8 (and working well) and the page even declares utf-8 charset itself(in <meta> tag). But the names are still corrupted.

Access to the gallery is temporarily restricted to the public, so the link would be of no use, but I can post screenshot:


whitewash

Can't edit the previous post :(

The gallery was bridged into SMF1.1.x forum (and will be again as soon as it goes back online)

Αndré

Quote from: whitewash on September 06, 2010, 03:49:19 PM
All database tables' charsets and collations are set to utf8, Coppermine charset is set to utf8
Then your content is maybe not utf-8 encoded. Try other encodings.

whitewash

Hello,
I'm pretty sure it is, it was set to utf8 from the beginning. When I enter phpmyadmin (with connection collation and charset set to utf8) and browse `categories` table, all strings are OK

whitewash

After digging in Coppermine's code, I've found a workaround.  It's more a hack than a workaround, though :)

in include/functions.inc.php, function cpg_db_connect(), just before the last return, I added the following line:
mysql_query("SET NAMES 'utf8' COLLATE 'utf8_czech_ci'", $result);

Note for others if you have the same problem: this is not general solution, it would probably work for you as well, probably not, there surely is more elegant one :)

Αndré

Please see also that thread. Adding
$CONFIG['dbcharset'] = 'utf8'; to include/config.inc.php should also solve your problem.

whitewash

Unfortunately, I've found link to that topic in some other thread before, but I can't access it.

QuoteThe topic or board you are looking for appears to be either missing or off limits to you.