php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76286 transliterator_transliterate() -> converts "ℌ" into "x"
Submitted: 2018-04-29 07:45 UTC Modified: 2018-04-30 13:32 UTC
From: lars at moelleken dot org Assigned:
Status: Not a bug Package: intl (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
 [2018-04-29 07:45 UTC] lars at moelleken dot org
Description:
------------
When I try to convert unicode-text into ascii via  "transliterator_transliterate()" it converts "ℌ" into "x" instead of "H".

- demo: https://3v4l.org/DVIs7

- sample-unicode (for more tests?): https://github.com/voku/portable-utf8/blob/master/tests/fixtures/sample-unicode-chart.txt

Test script:
---------------
$str = 'ℌ';

$str = transliterator_transliterate('NFD; [:Nonspacing Mark:] Remove; NFC; Any-Latin; Latin-ASCII;', $str);

var_dump($str);

Expected result:
----------------
H

Actual result:
--------------
x

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-04-30 13:32 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2018-04-30 13:32 UTC] ab@php.net
Thanks for the report. The transform used seems incorrect. NFD+NFC should be replaced by NFKC. See https://unicode.org/cldr/utility/character.jsp?a=%E2%84%8C

Thanks.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Feb 26 08:01:26 2020 UTC