| От | Tom Lane |
|---|---|
| Тема | tsearch is non-multibyte-aware in a few places |
| Дата | |
| Msg-id | 15580.1213892951@sss.pgh.pa.us обсуждение |
| Ответы |
Re: tsearch is non-multibyte-aware in a few places
|
| Список | pgsql-hackers |
I've identified the cause of bug #4253:
/* Trim trailing space */ while (*pbuf && !t_isspace(pbuf)) pbuf++; *pbuf
='\0';
At least on Macs, t_isspace is capable of returning "true" when pointed
at the second byte of a 2-byte UTF8 character. This explains the report
that the letter "�" has a problem when some other ones don't. Of
course pbuf needs to be incremented using pg_mblen not just ++.
I looked around for other occurrences of the same problem and found
a couple. I also found occurrences of the same pattern for skipping
whitespace:
while (*s && t_isspace(s)) s++;
This is safe if and only if t_isspace is never true for multibyte
characters ... can anyone think of a counterexample?
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера