Re: Invalid byte sequence for encoding "UTF8", caused due to non wide-char-aware downcase_truncate_identifier() function on WINDOWS

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Invalid byte sequence for encoding "UTF8", caused due to non wide-char-aware downcase_truncate_identifier() function on WINDOWS
Дата
Msg-id 22826.1307628449@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Invalid byte sequence for encoding "UTF8", caused due to non wide-char-aware downcase_truncate_identifier() function on WINDOWS  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Invalid byte sequence for encoding "UTF8", caused due to non wide-char-aware downcase_truncate_identifier() function on WINDOWS
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> But now that I re-think about it, I guess what I'm confused about is
> this code here:

>                 if (ch >= 'A' && ch <= 'Z')
>                         ch += 'a' - 'A';
>                 else if (IS_HIGHBIT_SET(ch) && isupper(ch))
>                         ch = tolower(ch);
>                 result[i] = (char) ch;

The expected behavior there is that case-folding of non-ASCII characters
will occur in single-byte encodings but nothing will happen to
multi-byte characters.  We are relying on isupper() to not return true
when presented with a character fragment in a multibyte locale.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SLRU limits
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Invalid byte sequence for encoding "UTF8", caused due to non wide-char-aware downcase_truncate_identifier() function on WINDOWS