Skip to content

iconv ASCII//TRANSLIT invalid argument #1495

Open

Description

@louismariegaborit

With php:8.3-fpm-alpine image, I encountered an error when using iconv with TRANSLIT argument.

echo é | iconv -f UTF-8 -t ASCII//TRANSLIT
iconv: destination charset ASCII//TRANSLIT: Invalid argument

On Ubuntu with iconv 2.35, this command works correctly.

Activity

  1. tianon commented on Feb 20, 2024

    @tianon
    Member

    I think this is probably better suited to an Alpine/musl specific forum, as it's not really related to PHP (and is likely more about musl not really having full locale support: https://wiki.musl-libc.org/open-issues)

  2. LaurentGoderre commented on Apr 11, 2024

    @LaurentGoderre
    Member

    Manually downgrading libiconv seems to solve the issue

    Edited:

    /var/www/html # apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.12/community/ gnu-libiconv=1.15-r2
    OK: 21 MiB in 37 packages
    /var/www/html # export LD_PRELOAD=/usr/lib/preloadable_libiconv.so
    /var/www/html # echo é | iconv -f UTF-8 -t ASCII//TRANSLIT
    'e
    
  3. louismariegaborit commented on Jun 24, 2024

    @louismariegaborit
    Author

    @LaurentGoderre I've tested the downgrade but same result.
    image

  4. LaurentGoderre commented on Jun 25, 2024

    @LaurentGoderre
    Member

    I forgot a part to the solution, you also need to use

    export LD_PRELOAD=/usr/lib/preloadable_libiconv.so
    
  5. Magnum5234 commented on Oct 21, 2026

    @Magnum5234

    This is an old Alpine/glibc issue. Just use intl or use the compat library as suggested.

    also see: pimcore/pimcore#3175

    Also this was discussed here, wasn't it? #240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions