Re: convert accented character to base character

From: Mathieu De Zutter <mathieu(at)dezutter(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: convert accented character to base character
Date: 2010-06-28 16:00:32
Message-ID: 4C28C720.6060109@dezutter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 28/06/10 17:22, Neubert Joachim wrote:
>
> I want to convert accented characters to the according base character,
> e.g. "Ü" or "Ú" to "U".
>
I have the following:

CREATE OR REPLACE FUNCTION unaccent(TEXT) RETURNS TEXT AS
$$
use Text::Unaccent;
return unac_string('UTF8', $_[0]);
$$ LANGUAGE plperlu IMMUTABLE STRICT;

On debian you need the following package:
libtext-unaccent-perl

Kind regards,
Mathieu

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Konstantin Izmailov 2010-06-28 16:11:53 Re: PQprepare in PostgreSQL 7.4 (lack of SAVEPOINTs)
Previous Message Thom Brown 2010-06-28 15:44:02 Re: convert accented character to base character