php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66278 Transliteration with iconv() on Windows
Submitted: 2013-12-12 18:24 UTC Modified: 2014-03-27 11:26 UTC
Votes:2
Avg. Score:3.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: kacper at kacper dot se Assigned:
Status: Not a bug Package: ICONV related
PHP Version: 5.4.22 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: kacper at kacper dot se
New email:
PHP Version: OS:

 

 [2013-12-12 18:24 UTC] kacper at kacper dot se
Description:
------------
When iconv is used for transliteration on Linux, characters such as ä become ae. On Windows, iconv returns "a instead of ae (note the double quote before the letter).

Test script:
---------------
$utf8_umlaut_a = 'ä';

// On Linux ä = ae
setlocale(LC_CTYPE, 'de_DE');
echo iconv('UTF-8', 'ASCII//TRANSLIT', $utf8_umlaut_a);

// On Windows ä = "a
setlocale(LC_CTYPE, 'german');
echo iconv('UTF-8', 'ASCII//TRANSLIT', $utf8_umlaut_a);

Expected result:
----------------
On Windows iconv should return the same result as on Linux. ä should be returned as ae and not "a.

Actual result:
--------------
ä becomes "a.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-03-27 11:26 UTC] ab@php.net
-Status: Open +Status: Not a bug
 [2014-03-27 11:26 UTC] ab@php.net
This is how iconv handles it, please see http://git.savannah.gnu.org/cgit/libiconv.git/tree/lib/translit.def#n93 . The "ä" is represented as one char U-00E4, so what is done is completely how iconv thinks it should be.

I guess you'll see yet another handling on Mac, though have no machine to test. Anyway these are the issues with unicode normalization, not with PHP.

Thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 05:01:42 2025 UTC