pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jean-Luc Lachance <jllachan@nsd.ca>
To: Randall Lucas <rlucas@tercent.net>
Cc: mallah@trade-india.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Getting rid of accents..
Date: Wed, 28 May 2003 10:05:36 -0400
Message-ID: <3ED4C230.FB3DDD17@nsd.ca> (raw)
References: <E3DB8B8A-908C-11D7-923B-000A957653D6@tercent.net>

Have a look at translate().  It behaves like the unix command 'tr'.


Randall Lucas wrote:
> 
> Hi Mallah,
> 
> I had this problem once, and put together this bunch of regexes.  It's
> by no means optimal, but should solve 90% and would easily be adapted
> into a plperl function.
> 
> Begin perl:
>    $value =~ s/[\xc0-\xc6]/A/g;
>    $value =~ s/[\xc7]/C/g;
>    $value =~ s/[\xc8-\xcb]/E/g;
>    $value =~ s/[\xcc-\xcf]/I/g;
>    $value =~ s/[\xd1]/N/g;
>    $value =~ s/[\xd2-\xd6\xd8]/O/g;
>    $value =~ s/[\xd9-\xdc]/U/g;
>    $value =~ s/[\xdd]/Y/g;
> 
>    $value =~ s/[\xe0-\xe6]/a/g;
>    $value =~ s/[\xe7]/c/g;
>    $value =~ s/[\xe8-\xeb]/e/g;
>    $value =~ s/[\xec-\xef]/i/g;
>    $value =~ s/[\xf1]/n/g;
>    $value =~ s/[\xf2-\xf6\xd8]/o/g;
>    $value =~ s/[\xf9-\xfc]/u/g;
>    $value =~ s/[\xfd\xff]/y/g;
> 
> On Tuesday, May 27, 2003, at 04:55 PM, <mallah@trade-india.com> wrote:
> 
> >
> >
> > Is there any easy way for converting accented text to
> > closest text  without accents in postgresql ?
> >
> > eg:
> >
> > BÂLÂ MORGHÂB  to  BALA MORGHAB
> >
> >
> >
> >
> > Regds
> > Mallah.
> >
> >
> > -----------------------------------------
> > Get your free web based email at trade-india.com.
> >    "India's Leading B2B eMarketplace.!"
> > http://www.trade-india.com/
> >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
> >
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)



view thread (6+ messages)

Message-ID: <3ED4C230.FB3DDD17@nsd.ca>
Permalink:  ../3ED4C230.FB3DDD17@nsd.ca/
Also on:    postgresql.org/message-id/3ED4C230.FB3DDD17@nsd.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jllachan@nsd.ca, rlucas@tercent.net, mallah@trade-india.com
  Subject: Re: Getting rid of accents..
  In-Reply-To: <3ED4C230.FB3DDD17@nsd.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox