Advanced search  

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

Pages: [1]   Go Down

Author Topic: After upgrading from 1.4.x, non-ascii characters don't show properly  (Read 8577 times)

0 Members and 1 Guest are viewing this topic.

whitewash

  • Coppermine newbie
  • Offline Offline
  • Posts: 7

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:

Logged

whitewash

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: After upgrading from 1.4.x, non-ascii characters don't show properly
« Reply #1 on: September 06, 2010, 03:51:50 pm »

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)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: After upgrading from 1.4.x, non-ascii characters don't show properly
« Reply #2 on: September 06, 2010, 03:58:41 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.
Logged

whitewash

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: After upgrading from 1.4.x, non-ascii characters don't show properly
« Reply #3 on: September 06, 2010, 04:10:06 pm »

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
Logged

whitewash

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: After upgrading from 1.4.x, non-ascii characters don't show properly
« Reply #4 on: September 06, 2010, 05:28:49 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: After upgrading from 1.4.x, non-ascii characters don't show properly
« Reply #5 on: September 06, 2010, 05:51:55 pm »

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

whitewash

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: After upgrading from 1.4.x, non-ascii characters don't show properly
« Reply #6 on: September 06, 2010, 09:44:22 pm »

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

Quote
The topic or board you are looking for appears to be either missing or off limits to you.
Logged
Pages: [1]   Go Up
 

Page created in 0.027 seconds with 19 queries.