Re: BUG #3730: Creating a swedish dictionary fails

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #3730: Creating a swedish dictionary fails
Дата
Msg-id 13391.1194634167@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #3730: Creating a swedish dictionary fails  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: BUG #3730: Creating a swedish dictionary fails  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-bugs
Alvaro Herrera <alvherre@commandprompt.com> writes:
> I am wondering if the newline being included in the token could be
> causing a problem.

Nope.  I traced through it and the problem is that char2wchar() is
completely brain-dead: at some places it thinks that "len" is the
length of the output wchar array, and at others it thinks that "len"
is the number of bytes in the input.  In particular, _t_isalpha()
fails completely for any multibyte character, because the pnstrdup
call truncates the character to 1 byte.

After looking at the callers I'm inclined to think that the only
safe way to implement this routine is to change its API to provide
both counts.  Comments?

            regards, tom lane

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #3737: lower/upper fails to match extended chars in LATIN1
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #3730: Creating a swedish dictionary fails