php / php/php-src

grapheme_* functions cannot catch differents between CJK Compatibility Ideographs and Unified Ideographs

Ouverte
#23,642 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@youkidearitai y travaille déjà.

Depuis le 10/9/2026.

Extension: intl Feature Status: Needs Triage
Langage dominant
C
Étoiles
40.4k
Forks
8.1k
Merge moyen
2 j 13 h
PR mergées (30 j)
96

Description

Description

follow code

var_dump(grapheme_levenshtein("神", "神")); // 神 is U+FA19, but normalize to U+795E(神)
Actual result
int(0)
But expected result
int(1)

Because CJK Compatibility Ideographs keeps backword compatible, However, Normalized Compatible Ideograph(Unified Ideographs) users feels differents.
So I think create catch the CJK Compatible Ideographs one option in grapheme_* functions.

This behavior is ICU depends.

CJK Compatible Ideographs

U+F900-U+FA0B Pronuncation variants from KS X 1001:1998 (Korea)
U+FA0C-U+FA0D Duplicate characters from Big 5 (Taiwan)
U+FA0E-U+FA2D The IBM 32 compatibility ideographs (Japan)
U+FA2E-U+FA2F Korean compatibility ideographs (Korea)
U+FA30-U+FA6A JIS X 0213 compatibility ideographs (Japan)
U+FA30-U+UA6D ARIB compatibility ideographs (Japan)
U+FA70-U+FAD9 DPRK compatibility ideographs (North Korea)

How to catch different

  1. Call ublock_getCode
  2. Return value of ublock_getCode is judge to CJK Compatible Ideograph: UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS || UBLOCK_CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.