Re: collation & UTF-8

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: collation & UTF-8
Дата
Msg-id 20060224172913.GA9390@svana.org
обсуждение исходный текст
Ответ на collation & UTF-8  (Tomi NA <hefest@gmail.com>)
Ответы Re: collation & UTF-8  (Tomi NA <hefest@gmail.com>)
Список pgsql-general
On Fri, Feb 24, 2006 at 06:23:07PM +0100, Tomi NA wrote:
> I'm using PosgreSQL 8.1.2 on linux and want to load UTF-8 encoded varchars.
> While I can store and get at stored text correctly, the ORDER BY places all
> accented characters (Croatian, in this case - probably marked hr_HR) after
> non-accented characters.
> This is no showstopper, but it does affect the general perception of
> application quality.

Collation is a function of the OS. Basically, is the locale of your
database setup for UTF-8 collation? It would probably be called
hr_HR.UTF-8.

> is there an official way to set up UTF8 collation so that "SELECT first_name
> FROM persons ORDER BY first_name" works as expected?

Yes, setup the locale correctly. In general, postgresql should give the
same results as sort(1) on the command-line. Use that to experiment.

LC_ALL=hr_HR.UTF-8 sort < input > output

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Tomi NA
Дата:
Сообщение: collation & UTF-8
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: ltree + gist index performance degrades significantly over a night