Re: Almost bug in COPY FROM processing of GB18030 encoded input

2019-01-25 Thread Heikki Linnakangas
On 24/01/2019 23:27, Robert Haas wrote: On Wed, Jan 23, 2019 at 6:23 AM Heikki Linnakangas wrote: I happened to notice that when CopyReadLineText() calls mblen(), it passes only the first byte of the multi-byte characters. However, pg_gb18030_mblen() looks at the first and the second byte.

Re: Almost bug in COPY FROM processing of GB18030 encoded input

2019-01-24 Thread Robert Haas
On Wed, Jan 23, 2019 at 6:23 AM Heikki Linnakangas wrote: > I happened to notice that when CopyReadLineText() calls mblen(), it > passes only the first byte of the multi-byte characters. However, > pg_gb18030_mblen() looks at the first and the second byte. > CopyReadLineText() always passes \0 as

Almost bug in COPY FROM processing of GB18030 encoded input

2019-01-23 Thread Heikki Linnakangas
Hi, I happened to notice that when CopyReadLineText() calls mblen(), it passes only the first byte of the multi-byte characters. However, pg_gb18030_mblen() looks at the first and the second byte. CopyReadLineText() always passes \0 as the second byte, so pg_gb18030_mblen() will incorrectly