Problems with case-insensitive comparing of national characters
Posted by: Bjarne Betjent
Date: May 04, 2005 06:36AM


I have a major problem concerning searching for text containing norwegian special characters. I run mysql 4.0.12 on OS X. The default char set is latin1.

Suppose now I have a field containing the word 'Ørret'. If I do a search like "WHERE field LIKE '%Ørret%'" I will find this column. So is the case if I search with "WHERE field LIKE '%ØrrET%' " since the LIKE operator in mysql is not case sensitive as long as none of the operands is a binary string. (The field in question is a varchar field)

But as soon as I replace the letter 'Ø' with the lowercase 'ø' in the search it does not work any longer. It seems to me that the case insensitivity only goes for letters a-z/A-Z.

I found the same problem using the UPPER() function:

mysql > SELECT UPPER('test æøå');

| UPPER('test æøå') |
| TEST æøå |

The three norwegian characters at the end is not transformed to the uppercase 'ÆØÅ' as I would expect.

Does anyone here know what the problem is, and how I can fix this?

Options: ReplyQuote

Written By
Problems with case-insensitive comparing of national characters
May 04, 2005 06:36AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.