Re: match accented chars with ASCII-normalised version

From: "Jaime Casanova" <systemguards(at)gmail(dot)com>
To: brian <brian(at)zijn-digital(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: match accented chars with ASCII-normalised version
Date: 2008-01-28 02:40:56
Message-ID: c2d9e70e0801271840w25d3acc2oa7c4878afe8b3f60@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jan 25, 2008 12:02 AM, brian <brian(at)zijn-digital(dot)com> wrote:
> The client for a web application I'm working on wants certain URLs to
> contain the full names of members ("SEO-friendly" links). Scripts would
> search on, say, a member directory entry based on the name of the
> member, rather than the row ID. I can easily join first & last names
> with an underscore (and split on that later) and replace spaces with +,
> etc. But many of the names contain multibyte characters and so the URLs
> would become URL-encoded, eg:
>
> Adelina España -> Adelina_Espa%C3%B1a
>
> The client won't like this (and neither will I).
>
> I can create a conversion array to replace certain characters with
> 'normal' ones:
>
> Adelina_Espana
>
> However, I then run into the problem of trying to match 'Espana' to
> 'España'. Searching online, I found a few ideas (soundex, intuitive
> fuzzy something-or-other) but mostly they seem like overkill for this
> application.
>

what about using to_ascii() ?
http://www.postgresql.org/docs/8.3/static/functions-string.html

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
Richard Cook

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ow Mun Heng 2008-01-28 03:16:11 Re: [OT] Slony Triggers pulling down performance?
Previous Message Greg Smith 2008-01-28 00:07:11 Re: Very long execution time of "select nextval('..');"