Problem with Swedish characters and Keywords in Search Problem with Swedish characters and Keywords in Search
 

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

Problem with Swedish characters and Keywords in Search

Started by fjallfoto, December 08, 2010, 08:52:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fjallfoto

I've been uploading a lot of images last couple of weeks and have tested Coppermine and it seems to be what I'm looking for to my site.

http://www.fjallfoto.se/images/index.php

The only problem I've found is related to Keywords starting or ending with a swedish character such as å ä ö.

I use Lightroom and export the images with keywords in place and that works fine. But when I upload the files to Coppermine the swedish characters dissapear if the keywords either starts or end with them. This I resolved by manually checking all keywords after Uploading and filling in any lost characters. Some work but it's quite fast.

The problem now is that in the Search function any images starting with a swedish character can't be found either by typing in that word nor by clicking the keyword directly. However keywords ending with a swedish character now works fine. For instance "Umeå" works fine but "Öring" doesn't.

If I use the Keyword manager I can find all "Öring"-images with the "Search for all Öring images in new window". So the Keyword manager can find all the images but the Search function can't.

Hope I made this clear. I would really need to get this sorted out.

(Today I updated to 1.5.10 without any improvement, used 1.5.8 earlier)

Αndré

'öring' seems to work as expected: http://www.fjallfoto.se/images/thumbnails.php?album=search&keywords=on&search=%C3%B6ring

But I can confirm your issue with other keywords. Will perform some tests on my local testbed.

Αndré

I cannot replicate that behavior in my testbed. Maybe it's some weird kind of encoding issue that happens when you import the keywords? Can you please upload a test image and assign e.g. the keyword 'öron' manually. It currently returns 0 files and I want to see if it doesn't work in general or if it only happens for imported keywords.

fjallfoto

"öring" was a bad example, it's actually a part of the word "Dataförstöring". The images assigned the keyword "Öring" only doesn't pop up as they should, only Keywords with "öring" in the middle of the word.

Here if an example with "Öring":

http://www.fjallfoto.se/images/displayimage.php?pid=312

I tried exporting one image from Lightroom without any keywords, I actually removed them directly in Lightroom, and then uploaded the image in CPG

http://www.fjallfoto.se/images/displayimage.php?pid=1143

"Älg" "Snö" and "Vinter" was the keywords I assigned in CPG, "Snö" and "Vinter" works but not "Älg".

Αndré

Quote from: fjallfoto on December 09, 2010, 03:18:29 PM
"Snö" and "Vinter" works but not "Älg"
It works in my local testbed. Did you modified some Coppermine code or installed any plugins? Additionally, can you install a fresh version of cpg1.5.10 on the same server and test if it happens there, too?

fjallfoto

Ok, that's probably good. If it works for you it shouldn't be impossible to make it work for me.

Since I have no knowledge of PHP I haven't modified anything, and the only additions is a few more themes I have added.

When you import the image on your testbed, does the special characters in the beginning and end of the word dissapear? Or does everything run smooth so you can Upload the image without manually doing thing to the keywords?

I'm uploading a new database now, will get back with results as soon as it's up.

Αndré

Quote from: fjallfoto on December 09, 2010, 03:54:29 PM
When you import the image on your testbed, does the special characters in the beginning and end of the word dissapear?
When I upload http://www.fjallfoto.se/images/displayimage.php?pid=312 to my gallery, it imports no keywords.

fjallfoto

Quote from: Αndré on December 09, 2010, 04:05:33 PM
When I upload http://www.fjallfoto.se/images/displayimage.php?pid=312 to my gallery, it imports no keywords.

Of course, stupid me.

I've now set up a fully new CPG 1.5.10 and imported 2 images without any keywords, added the Keywords "Snö" "Vinter" and "Älg" manually and I still have the same problem.

http://www.fjallfoto.se/tstgal2/index.php

What else could be the problem?

Αndré

Add
$CONFIG['dbcharset'] = 'utf8';
to include/config.inc.php of your test gallery. It will probably break your keyword. If that's the case, just re-add them.

fjallfoto

Quote from: Αndré on December 09, 2010, 04:58:06 PM
Add
$CONFIG['dbcharset'] = 'utf8';
to include/config.inc.php of your test gallery. It will probably break your keyword. If that's the case, just re-add them.

Ok, I tried this in one of my test-gallerys and it seems to work. But the problem with ÅÄÖ as first or last character still persists, they dissapear during import so they have to be added manually afterwards.

Is this possible to fix or is it something I have to live with?

The most important thing is that all words are searchable.

For re-adding the keywords, is the most simple way to delete all files and import them again? I can't find a function for reading the Keywords from the images again.

Αndré

Quote from: fjallfoto on December 09, 2010, 06:48:20 PM
But the problem with ÅÄÖ as first or last character still persists, they dissapear during import so they have to be added manually afterwards.

Please apply the fix of svn revision 8131 and try again.

fjallfoto

Quote from: Αndré on December 14, 2010, 04:28:06 PM
Please apply the fix of svn revision 8131 and try again.

I applied this in one of my test-gallery but it seems to be the same result as previously.

However I can live with this problem, I riffle through all the keywords anyways after I've imported the images.