Thank you for your answer, but I'm working with a lot of languages, so I 
don't know where someone can put an accent.

For the moment, I just discovered that I can't remove the accents with 
Iconv like I said before. Here, it works only under irb.. I described 
this problem here: http://www.ruby-forum.com/topic/70827#738081
Another problem with utf-8 under ruby is that ruby can't index correctly 
the string. For example: 'áb'[2..2] gives the second half of 'á'. I 
discovered how to workaround using the unicode version of regexp:
$KCODE = 'u'
'áb'.split(//m) == ["á", "b"]

Without these problems, I think that I know how to make it without false 
matchs with an ugly loop.
If str and regexp are the versions without accents, str =~ regexp gives 
the position of the match and str[regexp].length the length. With these 
two numbers, It's possible to make the highlight in the original string.
It's something like:
ascii_string = Iconv.conv('US-ASCII//TRANSLIT','UTF-8',string)
ascii_search = Iconv.conv('US-ASCII//TRANSLIT','UTF-8',search)
regexp = Regexp.new(Regexp.escape(ascii_search),true)
position = (ascii_string =~ regexp)
size = ascii_string[regexp].length
highlighted = ascii_string[0..(position-1)]+'<span 
class="highlight">'+ascii_string[position..(position+size-1)]+'</span>'+ascii_string[(position+size)..-1]

Of course, it need some modifications to put this in a loop (and I need 
to use the vector version of the string to index correctly the string).
-- 
Posted via http://www.ruby-forum.com/.