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: Search-page with wrong swedish letters  (Read 3354 times)

0 Members and 1 Guest are viewing this topic.

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Search-page with wrong swedish letters
« on: March 26, 2014, 06:45:22 pm »

The search-page is displaying swedish characters wrong (the indexed words). Can be seen at: uppsalafoto.se/galleri/search.php
Any tips?
Thanks
Logged
Human

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Search-page with wrong swedish letters
« Reply #1 on: March 27, 2014, 01:08:41 am »

Looks like a character set issue...
Several questions:
What charset/collation is used in your MySQL tables?
What charset is specified in cpg config?
Do you have a charset override in config.inc.php? ($dbcharset =)
If you view the keywords in your database via a tool like phpMyAdmin, does it look normal?

I am guessing you are using other than utf8 - the cpg recommended value - and something has 'corrupted' the data.

This thread http://forum.coppermine-gallery.net/index.php/topic,77017.0.html was my last trip down this road...
Some ideas of how we solved that known the thread.... It was far more than the keywords.

Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: Search-page with wrong swedish letters
« Reply #2 on: March 27, 2014, 11:01:47 am »

Thanks,
If I view the keywords in phpmyadmin they are wrong aswell.. titles too. So it says PÃ¥byggnad instead of Påbyggnad.
Collation looks like it is latin1_swedish_ci.
The charset in the config in cpg is utf-8.
Weird thing is problem only occurs on search-page..
Logged
Human

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Search-page with wrong swedish letters
« Reply #3 on: March 27, 2014, 02:24:29 pm »

I assume you recently updated to cpg1.5.26 and it worked as expected before the upgrade? If so, please read this post, apply the patch and report if it fixes your issue.
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Search-page with wrong swedish letters
« Reply #4 on: March 27, 2014, 03:49:36 pm »

Try Αndré's fix first... but since you are seeing 'interesting' data via phpMyAdmin, I am guessing it may not address.

These types of issues have shown themselves in unusual ways...
The last one displayed perfectly fine on one server - but when moved to a new server had the issue...

MySQL appears to try to 'fix' some of the issues - and some system settings appear to be able to influence that... so the errors that appear can seem 'inconsistent'. The view through phpMyAdmin being incorrect is the key I see to say there is a data problem. This should not happen if everything is as it should be...

To correct the data:
  • Backup your CPG tables (or perform this on a test copy)
  • Identify the tables and fields with data issues. These are usually contained to fields accepting user input like album title, picture caption, keywords, even filenames and some config values.
  • Alter the CPG tables to be utf-8. This should be done for all CPG tables.
  • Update the affected fields - converting the data from latin1 to binary to utf-8.
  • If data doesn't view properly, add $CONFIG['dbcharset'] = 'utf8' to config.inc.php

SQL to convert to utf-8 (once for each table):
Code: [Select]
ALTER TABLE cpg_albums CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;SQL to 'fix' corrupted data (once for each field to be fixed):
Code: [Select]
UPDATE cpg_albums SET title= CONVERT(CAST(CONVERT(title USING latin1) AS binary) USING utf8);
Try this on one of your tables... If it works, and you want a script to do them all, let me know... I can revise what I used last time.
Let me know your results.

(EDIT: changed $dbcharset to $CONFIG['dbcharset'] to correct previous typo...)
« Last Edit: June 29, 2014, 01:55:13 am by gmc »
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

nickelas

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 114
Re: Search-page with wrong swedish letters
« Reply #5 on: April 03, 2014, 05:04:27 pm »

Seems the update (1.5.28) solved it.
Logged
Human

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Search-page with wrong swedish letters
« Reply #6 on: April 03, 2014, 09:01:31 pm »

Thanks for the report :)
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.