Skip to content

iconv bug - incorrect conversion #16328

@ssj4maiko

Description

@ssj4maiko

Description

The following code:

<?php
$string = 'Relámpago';
echo iconv('UTF-8', 'ASCII//TRANSLIT', $string)."\n";

Resulted in this output:

Rel'ampago

But I expected this output instead:

Relampago

Running iconv via CLI, the value is properly converted.

iconv -f 'UTF-8' -t 'ASCII//TRANSLIT' iconvinput.php
<?php
$string = 'Relampago';
echo iconv('UTF-8', 'ASCII//TRANSLIT', $string)."\n";
$ iconv -V
iconv (Ubuntu GLIBC 2.39-0ubuntu8.3) 2.39

PHP Version

PHP 8.3.4

Operating System

Ubuntu 24.04 (Docker container webdevops/php-apache-dev)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions