ascii to latin1

Rene Pijlman reply.in.the.newsgroup at my.address.is.invalid
Mon May 8 21:00:50 EDT 2006


Luis P. Mendes:
>I'm developing a django based intranet web server that has a search page.
>
>Data contained in the database is mixed.  Some of the words are
>accented, some are not but they should be.  This is because the
>collection of data  began a long time ago when ascii was the only way to go.
>
>The problem is users have to search more than once for some word,
>because the searched word can be or not be accented.  If we consider
>that some expressions can have several letters that can be accented, the
>search effort is too much.

I guess the best solution is to index all data in ASCII. That is, convert
a field to ASCII (from accented character to its unaccented constituent)
and index that.

Then, on a search, you also need to unaccent the search phrase, and match
it against the asciified index.

-- 
René Pijlman



More information about the Python-list mailing list