Re: [HACKERS] tsearch is non-multibyte-aware in a few places

2008-06-19 Thread Tom Lane
I wrote: > This is safe if and only if t_isspace is never true for multibyte > characters ... can anyone think of a counterexample? Non-breaking space is a counterexample, so I pg_mblen-ified those loops too. Fortunately this code only executes during dictionary cache load, so a few extra cycles

[HACKERS] tsearch is non-multibyte-aware in a few places

2008-06-19 Thread Tom Lane
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. Thi