Re: search strings using foreign characters

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




Dica wrote:
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?


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.

.



Relevant Pages

  • Re: search strings using foreign characters
    ... special characters and replacing with standard ones when searching our ... try replacing all the special characters with _. ...
    (microsoft.public.sqlserver)
  • Re: looping through text with array_key_exists function
    ... This gives me one large string that I can easily insert into a webpage. ... // start replacing; the special characters will generate invalid image ... you will only have to maintain the $special array and leave the ...
    (alt.php)
  • Re: looping through text with array_key_exists function
    ... Tricky thing, however, is that img tags contain spaces and you only want to ... // start replacing; the special characters will generate invalid image ... you will only have to maintain the $special array and leave the ...
    (alt.php)
  • Re: tclsoap illegal characters
    ... so we ended up writing a parser to look for those special characters in ... values and "solve" the problem by replacing with something else or a ... Kind regards ...
    (comp.lang.tcl)
  • Working With Ampersands
    ... How does one allow the use of ampersands (or other special characters ... for that matter) within Element text and Attribute text? ... Jill"/>" into an XmlDocument. ...
    (microsoft.public.dotnet.xml)