I've been using the code below for normalization. Any characters
without
ascii equivalents are stripped:
import unicodedata
nfkd = unicodedata.normalize('NFKD', data)
normalized = nfkd.encode('ascii', 'ignore').lower()
It seems to work well so far for prefix suggest, except when the
datastore
query contains spaces it will fail. Ideas anyone?
On Jan 13, 8:25 am, Tom <[email protected]> wrote:
> I need some suggestions/guidance on how to handle strings that contain
> characters like "François Pétillant".
>
> I have several problems.
>
> First, I do want to store these names in their original encoding
> (which I think I can do in a db.Text object).
>
> I also want to be able to search their names with or without the
> special characters. (eg. "François" and "Francois" would both in the
> SearchableModel's tags) Any utility to convert sensibly?
>
> Finally, I want to be able to send back the name in utf-8 in a format
> that can be converted back to the original on the user side. (In this
> specific case the wine name is being sent back to my android phone
> app.)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---