public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: [email protected]
Subject: pgsql: Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE)
Date: Thu, 04 Jun 2026 22:50:39 +0000
Message-ID: <[email protected]> (raw)

Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE)

The NFC recomposition incorrectly included TBASE as a valid T syllable,
which is incorrect based on the Unicode specification (TBASE is one
below the start of the range, range beginning at U+11A8).

This would cause the TBASE to be silently swallowed in the
normalization, leading to an incorrect result.

A couple of regression tests are added to check more patterns with
Hangul recomposition and decomposition, on top of a test to check the
problem with TBASE.  Diego has submitted the code fix, and I have
written the tests.

Author: Diego Frias <[email protected]>
Co-authored-by: Michael Paquier <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/82116023e424cba4ac7adefd261bd382ad6e40c8

Modified Files
--------------
src/common/unicode_norm.c             |  2 +-
src/test/regress/expected/unicode.out | 78 +++++++++++++++++++++++++++++++++++
src/test/regress/sql/unicode.sql      | 20 +++++++++
3 files changed, 99 insertions(+), 1 deletion(-)



view thread (6+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE)
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox