Thursday, June 6, 2013

Re: Search for a substring in a string ignoring accented characters

On 04/06/2013 15:27, Eric Bouchut wrote:
> I cannot find a way, using GWT's *_JRE emulation_,* to :
>
> * *search* *for a* sub *string* in a String *ignoring accented characters* (diacritics)
> * *remove accented characters* from a String

Remove or replace?
Remove is relatively trivial. For example, iterate on each character. If its code is below
127, add it to a string builder.
Replace is harder: you need a way to map éèëê and similar to e, àää and such to a, and so on.
Search by "ignoring accented chars" raises the same questions: is searching "ca" matching
"ça" or "àcça"?

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment