Re: proposal: UTF8 to_ascii function - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: UTF8 to_ascii function
Date
Msg-id 162867790808110748i1b4af15epbbd4c2ef0d9473bf@mail.gmail.com
Whole thread Raw
In response to Re: proposal: UTF8 to_ascii function  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
2008/8/11 Andrew Dunstan <andrew@dunslane.net>:
>
>
> Pavel Stehule wrote:
>>
>>
>> One note - convert_to is correct. But we have to use to_ascii without
>> decode functions. It has same behave - convert from bytea to text.
>> Text in "incorrect" encoding is dafacto bytea. So correct to_ascii
>> function prototypes are:
>>
>> to_ascii(text)
>> to_ascii(bytea, integer);
>> to_ascii(bytea, name);
>>
>>
>>>
>>>
>
> What you have not said is how you propose to convert UTF8 to ASCII.
>
> Currently to_ascii() converts a small number of single byte charsets to
> ASCII by folding the chars with high bits set, so what we get is a pure
> ASCII result which is safe in any server encoding, as they are all ASCII
> supersets.
>
> But what conversion rule will you use for the gazillions of Unicode
> characters?
>
> I honestly do not understand the use case for this at all.
>

It's typical case in czech language, where some searchings are accents
insensitive - Stěhule, Stehule, Novotný, Novotny.

> cheers
>
> andrew
>

pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: Proposal: PageLayout footprint
Next
From: "Pavel Stehule"
Date:
Subject: Re: proposal: UTF8 to_ascii function