From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix comments that claimed that mblen() only looks at first byte.
Date: Fri, 25 Jan 2019 12:55:22 +0000
Message-ID: <E1gn110-0005FJ-2T@gemulon.postgresql.org> (raw)
Fix comments that claimed that mblen() only looks at first byte.
GB18030's mblen() function looks at the first and the second byte of the
multibyte character, to determine its length. copy.c had made the
assumption that mblen() only looks at the first byte, but it turns out to
work out fine, because of the way the GB18030 encoding works. COPY will
see a 4-byte encoded character as two 2-byte encoded characters, which is
enough for COPY's purposes. It cannot mix those up with delimiter or
escaping characters, because only single-byte ASCII characters are
supported as delimiters or escape characters.
Discussion: https://www.postgresql.org/message-id/7704d099-9643-2a55-fb0e-becd64400dcb%40iki.fi
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a5be6e9a1dfe820807f9ccb21dec5144982618e6
Modified Files
--------------
src/backend/commands/copy.c | 7 ++++++-
src/backend/utils/mb/wchar.c | 32 +++++++++++++++++++++++++-------
2 files changed, 31 insertions(+), 8 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: heikki.linnakangas@iki.fi
Subject: Re: pgsql: Fix comments that claimed that mblen() only looks at first byte.
In-Reply-To: <E1gn110-0005FJ-2T@gemulon.postgresql.org>
References: <E1gn110-0005FJ-2T@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox