Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Default normalization is NFD, not NFC as stated (on PHP 7.4) #75

Closed
bafetk opened this issue Sep 16, 2020 · 2 comments
Closed

Default normalization is NFD, not NFC as stated (on PHP 7.4) #75

bafetk opened this issue Sep 16, 2020 · 2 comments

Comments

@bafetk
Copy link

bafetk commented Sep 16, 2020

Using PHP 7.4, Patchwork/utf8 claims NFC as the default normalization. However, it is hardcoded to use "4" as the normalization. This is actually NFD.

Here are the constant values in PHP 7.4:
Normalizer::FORM_C => 16
Normalizer::FORM_D => 4
Normalizer::FORM_KC => 32
Normalizer::FORM_KD => 8
Normalizer::NONE => 2

@nicolas-grekas
Copy link
Contributor

Good catch, would you mind sending a PR to fix this?

@nicolas-grekas
Copy link
Contributor

Actually, the default is still NFC, because we don't use the value of native constants.
I'm still singing values with latest PHP versions.
Thanks for the report.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants