> On Jun 12, 2018, at 6:56 PM, Richard Levitte <[email protected]> wrote: > > Some implementations of the iconv library take the empty string as > the locale-specific encoding, but that is in no way universal, and > isn't specified in the standard: > > http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv_open.html > > Using nl_langinfo() to get the locale-specific encoding will, as far > as I know, always get you what you expect. On FreeBSD, after (required) calling: setlocale(LC_CTYPE, ""); The nl_langinfo(CODESET) returns the correct charset for by UTF-8 terminal emulator for which my environment has: LC_CTYPE=en_US.UTF-8 With that, iconv_open() and iconv() behave correctly converting to from ISO-8859-1 and UTF-8 (minimal tests). Without the setlocale() call, my encoding is always US-ASCII, and iconv is naturally crippled. -- Viktor. _______________________________________________ openssl-project mailing list [email protected] https://mta.openssl.org/mailman/listinfo/openssl-project
- Re: [openssl-project] To use or ... Richard Levitte
- Re: [openssl-project] To use or ... Richard Levitte
- Re: [openssl-project] To use or ... Viktor Dukhovni
- Re: [openssl-project] To use or ... Bernd Edlinger
- Re: [openssl-project] To use or ... Richard Levitte
- Re: [openssl-project] To use or ... Richard Levitte
- Re: [openssl-project] To use or ... Viktor Dukhovni
- Re: [openssl-project] To use or ... Richard Levitte
- Re: [openssl-project] To use or ... Viktor Dukhovni
- Re: [openssl-project] To use or ... Richard Levitte
- Re: [openssl-project] To use or ... Viktor Dukhovni
- Re: [openssl-project] To use or not use the iconv API, and... Richard Levitte
- Re: [openssl-project] To use or not use the iconv API... Andy Polyakov
- Re: [openssl-project] To use or not use the iconv... Benjamin Kaduk
- Re: [openssl-project] To use or not use the i... Salz, Rich
- Re: [openssl-project] To use or not use the i... Kurt Roeckx
- Re: [openssl-project] To use or not use the iconv... Richard Levitte
- Re: [openssl-project] To use or not use the iconv API... Viktor Dukhovni
- Re: [openssl-project] To use or not use the iconv... Richard Levitte
- Re: [openssl-project] To use or not use the iconv API... Kurt Roeckx
- Re: [openssl-project] To use or not use the iconv API... Andy Polyakov
