pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add direct conversion routines between EUC_TW and Big5.
Date: Thu, 28 Jan 2021 12:56:19 +0000
Message-ID: <E1l56qR-0005Mf-4n@gemulon.postgresql.org> (raw)

Add direct conversion routines between EUC_TW and Big5.

Conversions between EUC_TW and Big5 were previously implemented by
converting the whole input to MIC first, and then from MIC to the target
encoding. Implement functions to convert directly between the two.

The reason to do this now is that I'm working on a patch that will change
the conversion function signature so that if the input is invalid, we
convert as much as we can and return the number of bytes successfully
converted. That's not possible if we use an intermediary format, because
if an error happens in the intermediary -> final conversion, we lose track
of the location of the invalid character in the original input. Avoiding
the intermediate step makes the conversions faster, too.

Reviewed-by: John Naylor
Discussion: https://www.postgresql.org/message-id/b9e3167f-f84b-7aa4-5738-be578a4db924%40iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6c5576075b0f93f2235ac8a82290fe3b6e82300d

Modified Files
--------------
.../euc_tw_and_big5/euc_tw_and_big5.c              | 144 +++++++++++++++++++--
1 file changed, 134 insertions(+), 10 deletions(-)



Message-ID: <E1l56qR-0005Mf-4n@gemulon.postgresql.org>
Permalink:  ../E1l56qR-0005Mf-4n@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1l56qR-0005Mf-4n@gemulon.postgresql.org

 · 

reply

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: Add direct conversion routines between EUC_TW and Big5.
  In-Reply-To: <E1l56qR-0005Mf-4n@gemulon.postgresql.org>
  References: <E1l56qR-0005Mf-4n@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