proposal: UTF8 to_ascii function - Mailing list pgsql-hackers

From Pavel Stehule
Subject proposal: UTF8 to_ascii function
Date
Msg-id 162867790808110039xd20a016oac912e39343e7514@mail.gmail.com
Whole thread Raw
Responses Re: proposal: UTF8 to_ascii function  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Hello,

combination functions to_ascii and convert_to is broken now. Problem
is in convert_to function. It doesn't support 8bit output encoding.

Current workaround:

CREATE FUNCTION to_ascii(bytea, name)
RETURNS text AS 'to_ascii_encname' LANGUAGE internal;

SELECT to_ascii(convert_to('Příliš žlutý kůň', 'latin2'),'latin2');

I don't expect column collate for 8.4, so we need to have workable
to_ascii function.

I propose function to_ascii(text, name) that internally convert text
from utf8 encoding when it's necessary.

Regards
Pavel Stehule

pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Proposal: PageLayout footprint
Next
From: "Heikki Linnakangas"
Date:
Subject: Re: Proposal: PageLayout footprint