Re: patch: utf8_to_unicode (trivial)
| От | Tom Lane |
|---|---|
| Тема | Re: patch: utf8_to_unicode (trivial) |
| Дата | |
| Msg-id | 3250.1281721832@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: patch: utf8_to_unicode (trivial) (Alvaro Herrera <alvherre@commandprompt.com>) |
| Ответы |
Re: patch: utf8_to_unicode (trivial)
|
| Список | pgsql-hackers |
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Excerpts from Robert Haas's message of vie ago 13 12:50:13 -0400 2010:
>> Oh, hey, look at that. Any thought on what to about the fact that our
>> two existing copies of utf2ucs() don't match? (one tests against 0xf8
>> where the other against 0xf0)
> I'm not sure why it's masking 0xf8 instead of 0xf0.
Because it wants to verify that this is in fact a 4-byte UTF8 code.
Compare the code (and comments) for pg_utf_mblen.
AFAICS the version in mbprint.c is flat out wrong, and the only reason
nobody's noticed is that it should never get passed a more-than-4-byte
sequence anyway.
regards, tom lane
В списке pgsql-hackers по дате отправления: