Re: PostgreSQL 8.3.7: soundex function returns UTF-16 characters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PostgreSQL 8.3.7: soundex function returns UTF-16 characters
Дата
Msg-id 802.1239113181@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PostgreSQL 8.3.7: soundex function returns UTF-16 characters  (Frans <frans@geodan.nl>)
Список pgsql-bugs
Frans <frans@geodan.nl> writes:
> Does it make sense that the locale setting
> influences the workings of the soundex function?

Yeah, it absolutely would, because soundex depends on the C library's
isalpha() and toupper() functions, and those are influenced by locale.

It is clear from looking at the code that soundex isn't expecting
isalpha() to return true for anything except the ASCII letters A-Z,a-z.
That's true in the standard C locale but typically not true in others.
In your example with pi, I think the code would've indexed off the end
of its letter array and gotten unpredictable results.  We could/should
tighten that up, I think, even if we're not willing to rewrite the
code for full multibyte support just yet.

            regards, tom lane

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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: 8.2 pg_freespacemap crash
Следующее
От: Tom Lane
Дата:
Сообщение: Re: postgresql-8.3.6-1PGDG : redirect_stderr = on does not start server