Forum Moderators: open

Message Too Old, No Replies

mysql collation does not work as intended

latin1_german2_ci does not work

         

Garfield

11:11 pm on Jul 22, 2006 (gmt 0)

10+ Year Member



Hi,

I'm trying to get mysql to use the latin1_german2_ci collation. This collation is supposed to translate German umlauts (ä, ü, ö) into their counterparts (ö=oe, ü=ue, ä=ae) back and forth. Both forms are valid in German.

I need mysql to return all records that contain either one of these forms. If I run a search on "bär" I also want to get strings that contain "baer".

I set all mysql variables to latin1 and latin1_german2_ci, but it still does not work. I'm not sure if I'm getting this all wrong or if there's some error in my setup.

Please read [dev.mysql.com...] Scroll down to the part where it says what the german collations do. Is it just for sorting, or should a search on "ö" also return "oe"?

Thanks for any help!

Cheers

lammert

11:36 pm on Jul 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As far as I understand, literal strings like your 'baer' example are automatically recognized as latin1. To make a comparison with latin1_german2_ci entries in your database, you need to explicitly change the characterset for the literal string.

Adding COLLATE in your expressions might help to do this.