Differences between iconv from ports and iconv in base (transliteration)

Michael Gmelin freebsd at grem.de
Fri Dec 6 02:47:24 UTC 2013


On Fri, 6 Dec 2013 00:15:54 +0100
Michael Gmelin <freebsd at grem.de> wrote:

> I'm in the process of changing ports from ports iconv to iconv in
> base. I noticed that transliteration doesn't work in base as it does
> with iconv from ports. Examples:
> 
> "T\xc5\xbdst"
> ports: "TZst"
> base: "Tst"
> 
> "T\xe2\x82\xacst"
> ports: "TEURst"
> base: "Tst"
> 
> Conversion done using:
> iconv_open("ISO8859-1//IGNORE//TRANSLIT", "UTF-8");
> 
> Any ideas?
> 

I just checked /usr/src/lib/libc/iconv, it says in iconv_open:

        /*
         * Remove anything following a //, as these are options (like
         * //ignore, //translate, etc) and we just don't handle them.
         * This is for compatibility with software that uses these
         * blindly.
         */

So basically any software that depends on using these options
will break.

The porters handbook doesn't mention the fact that converters/libiconv
and native iconv are not equivalent [1].

I think this is problematic.

[1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/using-iconv.html

-- 
Michael Gmelin


More information about the freebsd-ports mailing list