]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix off-by-one with NFC recomposition for Hangul U+11A7 (TBASE)
authorMichael Paquier <michael@paquier.xyz>
Thu, 4 Jun 2026 22:50:15 +0000 (07:50 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 4 Jun 2026 22:50:15 +0000 (07:50 +0900)
commit82116023e424cba4ac7adefd261bd382ad6e40c8
tree09418f4fcb8fea9ce7f538a0cafe6814bcfd5a2d
parented5ca5828de1020bbcac392d36e5510842b12480
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 <mail@dzfrias.dev>
Co-authored-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/B92ED640-7D4A-4505-B09F-3548F58CBB16@dzfrias.dev
Backpatch-through: 14
src/common/unicode_norm.c
src/test/regress/expected/unicode.out
src/test/regress/sql/unicode.sql