Welcome! Log In Create A New Profile

Advanced

Problem to search word with accent

Posted by arianette 
Problem to search word with accent
June 22, 2011 01:25AM
Hello everybody,

It would be great if someone could help me ...

I can make search with quite all words, except word with accents. As it is addresed to french speaking persons, it s important to be able to make searche also with word with accents. For example if I search for the word "hanoi", it 's ok. But if I search for the word "Mékong", it says:

Voulez-vous dire : m�kong ?
La recherche "mékong" ne correspond à aucun document
--> -->

That means: do you mean M...kong. It doesn't match with any document.

I think the easiest way would be to ignore the accent written in the search box. Is it possible to do that ? How ?

Thanks so much,
Ariane
Re: Problem to search word with accent
August 19, 2011 03:30PM
I have a special function to solve this problem:

function fixAccent($string)
{
$string = str_replace(chr(0x92), "'",$string);
$string = str_replace(chr(0x96), "-",$string);
$string = str_replace(chr(0x95), "•",$string);
$string = str_replace(chr(0x9c), "oe",$string);
$string = str_replace(chr(0x97), "—",$string);
$string = str_replace(chr(0x91), "'",$string);
$string = utf8_encode($string);

return $string;
}

Jack
Sorry, only registered users may post in this forum.

Click here to login