Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 4.93 KB

README.md

File metadata and controls

22 lines (14 loc) · 4.93 KB

Source Unicode normalization tables

These tables support the password-preprocessing profiles without depending on Ruby's Unicode version. Do not replace them with the host's NFC implementation or combine normalizer variants during verification.

ID Source Identification
phpbb-bundled phpBB 3.1.12 at f38fce5ce570318ac64c95601e891cfe2e8f4d1a, includes/utf/utf_normalizer.php and its NFC tables SHA-256 fingerprint of the implementation, quick-check table, decomposition table, composition table, and common tables
patchwork Patchwork UTF8 1.3.1 (30ec6451aec7d2536f0af8fe535f70c764f2c47a), retained for the original migration regression SHA-256 fingerprint of Patchwork/PHP/Shim/Normalizer.php and its three canonical-normalization tables
patchwork-1.3.2 Patchwork UTF8 1.3.2 (d296e0026e7ce10b2a9fe594feca9628ef00e9e8), locked by phpBB 3.2.11 SHA-256 fingerprint of the same implementation and canonical-normalization table files
unicode-17.0.0 PHP 8.5.12 intl, ICU 78.1, Unicode 17.0.0 Unicode data version reported by IntlChar::getUnicodeVersion()

Patchwork 1.3.1 and 1.3.2 share the normalization algorithm and canonical composition/decomposition data, but 1.3.2 adds 117 combining-class entries. They therefore have distinct profile IDs and fingerprints. The existing patchwork ID continues to select 1.3.1; the source probe selects the matching catalog entry, and an unknown fingerprint is rejected. No login tries another profile after failure.

Each JSON contains the source identifier and fingerprint, fully expanded canonical decompositions, canonical composition pairs, and nonzero combining classes. Hangul decomposition/composition is algorithmic. The Patchwork path reproduces its L + V lookahead: it consumes at most one trailing Jamo, including U+11A7 (TBase), and does not then compose another trailing Jamo into the resulting syllable. The phpBB-bundled path preserves precomposed Hangul syllables, composes original L/V sequences with at most one following U+11A8–U+11C2 Jamo, and leaves an existing LV syllable plus T separate. These source behaviors differ from standard NFC and cannot be represented by the exported pair tables alone. The phpBB-bundled profile also replaces U+FFFE/U+FFFF as its implementation does. PHP source/helper verification, rather than the Ruby implementation, supplies the expected test results.

Regenerate inside a compatible PHP container using spec/fixtures/phpbb/export_normalizer.php /path/to/phpBB. The script reads the selected bundled implementation's tables, or enumerates the intl runtime's Unicode scalar values and canonical normalization. For old bundled sources use their matching runtime without intl. Never generate a different table under an existing ID without updating its provenance and validation. script/phpbb_normalizer.php checks the source identity against this catalog and rejects unrecognized implementations/data versions.

The bundled phpBB data is copyright phpBB Limited and distributed under GNU GPL v2, like this plugin. The Patchwork data is copyright Nicolas Grekas, distributed here under its GNU GPL v2 option (upstream also offers Apache License 2.0). The Unicode data exported from ICU is subject to the accompanying UNICODE-LICENSE.txt, taken from unicode-org/icu release-78.1/LICENSE. The Ruby normalization routine is a new implementation using these data tables.

Independent differential validation compared each normalizer with its source on 2,064,349 inputs: all valid Unicode scalar values, known decomposition/composition sequences, combining-character pairs after a starter, and deterministic mixed strings. The scripts and reproduction commands are in spec/fixtures/phpbb/README.md. That original corpus missed both bundled implementations' Hangul sequence behavior. The expanded corpus contains 2,958,109 inputs, including every L/V combination with trailing-Jamo boundaries, following characters, and precomposed syllables. Both corrected bundled paths match their actual PHP sources on that expanded corpus and on a separate 188,420-input reviewer corpus. Native Unicode 17 output is unchanged on the expanded corpus compared with the previous implementation; that stability check is not a fresh PHP-source comparison. Earlier before/after stability of the phpBB-bundled path did not establish source compatibility. These checks do not establish equivalence for every possible string or modified source runtime.

Fresh validation of both Patchwork versions against their actual PHP sources matched 2,958,109 inputs per version. Focused PHP-generated fixtures exercise their different combining-order acceptance and their shared Hangul behavior. The latest-release matrix includes phpBB 3.2.11 with Patchwork 1.3.2; only a small original-login regression and focused 1.3.1 library fixtures retain the earlier source. Native intl coverage remains limited to the identified Unicode 17.0.0 runtime; this catalog does not claim every PHP/runtime combination.