bug-gnu-libiconv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnu-libiconv] Please restore "UTF8" as alias for UTF-8 charset


From: Stuart Caie
Subject: [bug-gnu-libiconv] Please restore "UTF8" as alias for UTF-8 charset
Date: Thu, 10 Jan 2019 16:00:10 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Hello libiconv team,

please consider restoring "UTF8" as an alias for "UTF-8", which you made HPUX-only with the release of libtool 1.13.

It is not an HPUX-only alias. Removing it from vanilla libiconv reduced compatibility with other iconv implementations which support the "UTF8" name:

- glibc: https://sourceware.org/git/?p=glibc.git;a=blob;f=iconv/gconv_builtin.h;h=b96258129a3f192a2b8a30bd3d9c05a9ffd62901;hb=HEAD#l46 - newlib: supports "utf_8" and "utf8" but NOT "utf-8": https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=newlib/libc/iconv/encoding.aliases;hb=HEAD#l45 - uclibc: https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libiconv/iconv.c#n73
- musl: https://git.musl-libc.org/cgit/musl/tree/src/locale/iconv.c#n39
- dietlibc only supports "UTF-8"
- Bionic: https://android.googlesource.com/platform/bionic/+/master/libc/bionic/iconv.cpp#65 - FreeBSD 10+: https://web.mit.edu/freebsd/head/share/i18n/esdb/UTF/UTF.alias - NetBSD: http://cvsweb.netbsd.org/bsdweb.cgi/src/share/i18n/esdb/UTF/UTF.alias
- OpenBSD does not have an iconv() function and uses vanilla libiconv
- Darwin patches UTF8 back into libiconv: https://opensource.apple.com/source/libiconv/libiconv-51.200.6/libiconv/lib/encodings.def.auto.html - Cygwin patches UTF8 back into libiconv: https://github.com/cygwinports/libiconv/blob/master/1.14-aliases.patch   ("for better compatibility with glibc" https://cygwin.com/ml/cygwin/2015-02/msg00482.html)

I want to write software that can translate data to the UTF-8 charset. For that, I need a de-jure reliable name for that charset, as the parameters to iconv_open() are implementation-defined.

I picked "UTF8" after reviewing a lot of implementations, including pre-1.13 libiconv. I don't think I'm the only person on the planet to choose that, there are likely programs out there that chose "UTF8" as well, and would break if they were linked to libiconv >= 1.13

What I now need to is loop through possible names, including "UTF-8", "UTF8" and "UTF_8", until one of them works. But I'd prefer that every iconv_open() implementation support both "UTF-8" and "UTF8" and I could rely on either.

Regards
Stuart



reply via email to

[Prev in Thread] Current Thread [Next in Thread]