X-Original-To: pgsql-sql@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id B59189254FF for ; Wed, 28 May 2003 10:04:46 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 43840-05 for ; Wed, 28 May 2003 10:04:46 -0400 (EDT) Received: from beamish.nsd.ca (beamish.nsd.ca [205.150.156.194]) by developer.postgresql.org (Postfix) with ESMTP id 828B89254FB for ; Wed, 28 May 2003 10:04:45 -0400 (EDT) Received: (from smap@localhost) by beamish.nsd.ca (8.9.3/8.9.3) id KAA30537; Wed, 28 May 2003 10:04:40 -0400 X-Authentication-Warning: beamish.nsd.ca: smap set sender to using -f Received: from reddog.nsd.ca(192.168.101.30) by beamish.nsd.ca via smap (V2.1/2.1+anti-relay+anti-spam) id xma030535; Wed, 28 May 03 10:04:37 -0400 Received: from nsd.ca (jllachan-linux.nsd.ca [192.168.101.148]) by reddog.nsd.ca (8.8.7/8.8.7) with ESMTP id JAA31839; Wed, 28 May 2003 09:57:17 -0400 Message-ID: <3ED4C230.FB3DDD17@nsd.ca> Date: Wed, 28 May 2003 10:05:36 -0400 From: Jean-Luc Lachance X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.18-24.7.x i686) X-Accept-Language: en MIME-Version: 1.0 To: Randall Lucas Cc: mallah@trade-india.com, pgsql-sql@postgresql.org Subject: Re: Getting rid of accents.. References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by reddog.nsd.ca id JAA31839 X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/538 X-Sequence-Number: 13703 Have a look at translate(). It behaves like the unix command 'tr'. Randall Lucas wrote: >=20 > Hi Mallah, >=20 > 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. >=20 > Begin perl: > $value =3D~ s/[\xc0-\xc6]/A/g; > $value =3D~ s/[\xc7]/C/g; > $value =3D~ s/[\xc8-\xcb]/E/g; > $value =3D~ s/[\xcc-\xcf]/I/g; > $value =3D~ s/[\xd1]/N/g; > $value =3D~ s/[\xd2-\xd6\xd8]/O/g; > $value =3D~ s/[\xd9-\xdc]/U/g; > $value =3D~ s/[\xdd]/Y/g; >=20 > $value =3D~ s/[\xe0-\xe6]/a/g; > $value =3D~ s/[\xe7]/c/g; > $value =3D~ s/[\xe8-\xeb]/e/g; > $value =3D~ s/[\xec-\xef]/i/g; > $value =3D~ s/[\xf1]/n/g; > $value =3D~ s/[\xf2-\xf6\xd8]/o/g; > $value =3D~ s/[\xf9-\xfc]/u/g; > $value =3D~ s/[\xfd\xff]/y/g; >=20 > On Tuesday, May 27, 2003, at 04:55 PM, wrote: >=20 > > > > > > Is there any easy way for converting accented text to > > closest text without accents in postgresql ? > > > > eg: > > > > B=C2L=C2 MORGH=C2B 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 > > >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)