JOHAB character lengths

Started by PG Bug reporting form5 days ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/19/multibyte.html
Description:

The encodings listing in the documentation for postgres 19 shows JOHAB as
having characters that are 1-3 bytes long.

However as I understand the discussion about bug #19354, as well as the
Unicode Consortium's conversion table, JOHAB only has characters that are
1-2 bytes long.

Some of that discussion for bug #19354 went over my head —serves me right
for bringing it up!— but here's how I understand it: For some reason the
character verification function mistakenly accepted some 3-byte sequences
starting with 0x8f. However those would then still fail during conversion
to Unicode.

In the new, corrected code I would expect there to be only 1-byte and 2-byte
characters in JOHAB. In which case the entry in the encodings list needs
updating.

#2Daniel Gustafsson
daniel@yesql.se
In reply to: PG Bug reporting form (#1)
Re: JOHAB character lengths

On 20 Nov 2026, at 00:21, PG Doc comments form <noreply@postgresql.org> wrote:

The encodings listing in the documentation for postgres 19 shows JOHAB as
having characters that are 1-3 bytes long.

However as I understand the discussion about bug #19354, as well as the
Unicode Consortium's conversion table, JOHAB only has characters that are
1-2 bytes long.

The thread for #19354 confirms that JOHAB sequences are 2 bytes, the relevant
portion from Wikipedia referred to in that thread is:

"KS X 1001, since 1992, also defines an alternative encoding known as
Johab. This represents a Hangul syllable as the sequence of three
five-bit values, split across two 8-bit bytes, most significant bit
first"

What is more interesting though is that #19354 was never closed with the patch
applied, only the trivial comment fixes were applied. Thanks for bringing it
up, will revive the thread.

--
Daniel Gustafsson