Skip to content

Update is_printable to Unicode 17.0 - #4962

Merged
vitaut merged 1 commit into
fmtlib:mainfrom
FenjuFu:update-unicode-printable
Oct 4, 2026
Merged

vitaut merged 1 commit into
fmtlib:mainfrom
FenjuFu:update-unicode-printable

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Regenerate is_printable with support/printable.py against the current UnicodeData.txt (17.0.0). The table was last generated from Unicode 13.0, so code points assigned since then (e.g. 🫠 U+1FAE0 and CJK Extensions H/I/J) were escaped as unassigned.

The generated code is formatted with clang-format 21, and the script itself is unchanged.

The existing test used U+2A6DE as an unassigned code point, but it has been assigned since Unicode 14.0, so it is replaced with U+2A6E0, which is still unassigned. The PR also adds checks for code points from 14.0, 15.0 and 17.0.

Fixes #4961.

Signed-off-by: FenjuFu <fufenjupku@gmail.com>
@FenjuFu
FenjuFu requested a review from vitaut as a code owner September 30, 2026 12:48
@vitaut
vitaut merged commit 85a8f91 into fmtlib:main Oct 4, 2026
47 checks passed
@vitaut

vitaut commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Thank you!

james-panayis pushed a commit to james-panayis/fmt that referenced this pull request Oct 4, 2026
The U+1FAE0 and U+31350 cases added in fmtlib#4962 duplicate the is_printable
checks for the same code points. For a code point >= 0x80 needs_escape is
exactly !is_printable(cp), and the existing U+1F984 case already covers a
printable 4-byte sequence passing through unmodified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Characters added after Unicode 13.0 are escaped as unprintable

2 participants