Re: Concerning about Unicode-aware string handling

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Concerning about Unicode-aware string handling
Дата
Msg-id 14801.1337609055@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Concerning about Unicode-aware string handling  (Vincas Dargis <vindrg@gmail.com>)
Список pgsql-general
Vincas Dargis <vindrg@gmail.com> writes:
> Database created using:
> initdb -D ../data -E utf-8 -U postgres

That looks fairly dangerous, as it will absorb the database's locale
settings (particularly LC_CTYPE, which is what you care about for these
operations) from your shell environment.  If the environment locale is
not for UTF8 encoding then it won't work at all.  Best to specify a
--locale switch as well.  See
http://www.postgresql.org/docs/9.1/static/charset.html

> But regexp_replace issue is still there. Regexp "\w" understands only
> as "ascii word character" ?

Locale-specific character classes in regexps are not terribly bright
about UTF8, because historically that code has not considered any
character codes above 255 :-(.  So in UTF8 you only got correct behavior
for ASCII and LATIN1 characters.  9.2 will be better though not perfect:
http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=e00f68e49

            regards, tom lane

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

Предыдущее
От: Vincas Dargis
Дата:
Сообщение: Re: Concerning about Unicode-aware string handling
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Global Named Prepared Statements