tags:

views:

131

answers:

2

hi all

I'm using a database that contains contacts (fields like name, address, ...). If i'm using in my database a city that contains special chars (like ü) or html codes (like ü), then how can i convert them to u, so when i search for a city that contains that a special char should be shown in the result...

the database is MyISAM and Collation is latin1_swedish_ci (by default)

+2  A: 
  1. Your database shouldn't contain any HTML codes but symbols itself.
  2. With proper collation set, you will find both ü and u with your query

Edit: using collations example

Col. Shrapnel
can you tell me how to choose a collation
Remus Rigo
@Remus just `select something from some table where some column contents like 'u%'`
Col. Shrapnel
i'm using a lot of european and other chars, should I use utf8_unicode_ci ?
Remus Rigo
i just changed the table to utf8 and the fields from ü to ü, and when i run the query it doesn't recognize ü as u (no match found)
Remus Rigo
that's correct behavior. They're not the same symbol!
Paul McMillan
+1, best answer.
Tim Post
@Remus see addon to my post please
Col. Shrapnel
+1  A: 

you probably want to look at this article for other ideas and tools for how to solve your search problem. Normalizing your database search to latin-1 characters isn't the right solution.

http://www.alistapart.com/articles/accent-folding-for-auto-complete/

Paul McMillan