Author Topic: Wordlist problem (russian language)  (Read 5454 times)

0 Members and 1 Guest are viewing this topic.

Offline olgaart

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • FotoClub
Wordlist problem (russian language)
« on: June 16, 2009, 06:48:21 PM »
Hi everybody,

I have problems with search wordlist created in the database, with russian words. Some of them are OK, some are split to peaces, and some are not accepted at all.

Like here:
 http://www.fotoclub.robertmagel.de/details.php?image_id=390&l=russian

Что мне снег, что мне зной, что мне дождик проливной!..
"проливной" ist stored in the database, and "дождик" is not accepted.
(Incorrect string value: '\xD0\xD0\xBE\xD0\xB6\xD0...' for column 'word_text' at row 1)

My database is coded in UTF.

Does anybody have a solution?

Best regards, Olga

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Wordlist problem (russian language)
« Reply #1 on: June 17, 2009, 02:50:50 AM »
I confirm this. It's working fine if database is set to UTF8, but once 4images language is set to UTF8 some strange things start happening...
[EDIT]for some reason now, after I cleared up the database, I can't reproduce this problem anymore...[/EDIT]

For now, the solution is set to set collation in the database for word_text field in 4images_worldlist table to latin1_swedish_ci



You might need rebuild search index though (you can find plugin for that in our mods/plugins section).
« Last Edit: June 17, 2009, 03:33:55 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline olgaart

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • FotoClub
Re: Wordlist problem (russian language)
« Reply #2 on: June 17, 2009, 09:31:34 AM »
Hallo V@no,
now it produces following message:

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation.

Regargs,
Olga

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Wordlist problem (russian language)
« Reply #3 on: June 17, 2009, 03:34:20 PM »
replace includes/mysql_db.php with unmodified one. 4images doesn't use any collations. (don't forget make backups)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline olgaart

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • FotoClub
Re: Wordlist problem (russian language)
« Reply #4 on: June 17, 2009, 04:45:34 PM »
still the same:

DB Error: Bad SQL Query: SELECT word_text, word_id FROM phpbb_wordlist WHERE word_text IN ('Ð?вое', 'безÐомнÑ?Ñ?')
Illegal mix of collations (latin1_swedish_ci,IMPLICIT), (utf8_general_ci,COERCIBLE), (utf8_general_ci,COERCIBLE) for operation ' IN '

DB Error: Bad SQL Query: INSERT INTO phpbb_wordmatch (image_id, word_id, name_match, desc_match, keys_match) SELECT DISTINCT 424, word_id, 0, 1, 0 FROM phpbb_wordlist WHERE word_text = 'Ð?вое'
Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

DB Error: Bad SQL Query: INSERT INTO phpbb_wordmatch (image_id, word_id, name_match, desc_match, keys_match) SELECT DISTINCT 424, word_id, 0, 1, 0 FROM phpbb_wordlist WHERE word_text = 'безÐомнÑ?Ñ?'
Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='
Фотография была отредактирована.



The only difference is that the site title and category names look now like  ??????????? ??? ????? ? ??????
(in modified mysql_db.php  "@mysql_query('set character set utf8');" is included).


Like here: http://www.4homepages.de/forum/index.php?topic=24969.0

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: Wordlist problem (russian language)
« Reply #5 on: June 17, 2009, 04:55:41 PM »
weird...what mysql version do you have?
I've tested it on v5.0.41

google says it's most likely mysql v4.1 problem...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline olgaart

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • FotoClub
Re: Wordlist problem (russian language)
« Reply #6 on: June 17, 2009, 05:01:23 PM »
It is MySQL5.0
and it works exactly like described here
http://www.4homepages.de/forum/index.php?topic=24969.0

I beleave, it has something to do with function convert_special($text), because if I use search_utils.php from your file
http://www.4homepages.de/forum/index.php?topic=23095.0, it does not work at all.
« Last Edit: June 17, 2009, 05:32:57 PM by olgaart »