Accented character replacement for search then reinserted afterwards

Posted by user314573 on Stack Overflow See other posts from Stack Overflow or by user314573
Published on 2010-04-12T14:10:15Z Indexed on 2010/04/12 14:13 UTC
Read the original article Hit count: 243

Filed under:
|

Basically my issue is that users would like to search for a french word that has accented characters but without typing in the accented characters and then have the actual accented word appeared highlighted if found... So for example they would type in "declare" but in the result sets it would look like "déclare" and if found "déclare" would be highlighted.

My first thought was to just simply replace the characters with a regex but then I remembered that I would need to re-insert the replaced characters after the search... I was thinking of then using some sort of character map that would track position and the character so that when the search was finshed I could put the result set back to the way it was. This seems a little brute force to me and I was wondering if anyone had a better alternative? I'm using Visual Studio 2005 with this app.

Any advice would be much appreciated!

Thanks

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about visual-studio-2005