all groups > sql server (microsoft) > july 2006 >
You're in the

sql server (microsoft)

group:

search strings using foreign characters


search strings using foreign characters Dica
7/19/2006 2:30:34 PM
sql server (microsoft):
i've taken over a web app built by another developer. he was stripping out
special characters and replacing with standard ones when searching our
people table. for instance:

"é" was replaced with "e". this seemed to work fine and would return names
like 'Jose' as well as 'José'. as a matter of fact, 'é' doesn't even seem to
be recognized as a statement like 'select * from people where lastName like
'%é%' ' returns nothing. so, it seems like replacing é for e is the right
thing to do here.

however, he was also replacing "ã" with "a", but this character seems to be
different. if we replace "ã" with "a", i get no matches when searching for a
last name like "Simão".

anybody know why some of these characters are ignored while others aren't?

Re: search strings using foreign characters Damon
7/19/2006 3:13:57 PM

[quoted text, click to view]


Dica,

I personally have not had to deal with this issue. However, I might
try replacing all the special characters with _. So you would have the
statement. select * from people where lastName like '%Sim_o%' This
will replace any single character.

Hope this helps.
Damon.
Re: search strings using foreign characters Dica
7/20/2006 12:44:57 PM

[quoted text, click to view]


Dica,

I personally have not had to deal with this issue. However, I might
try replacing all the special characters with _. So you would have the
statement. select * from people where lastName like '%Sim_o%' This
will replace any single character.

Hope this helps.
Damon.

excellent suggestion. tks damon.

AddThis Social Bookmark Button