Date: Tue, 13 Oct 2015 11:53:46 +0200 From: Tijl Coosemans <tijl@FreeBSD.org> To: freebsd-questions@freebsd.org Cc: kora <kora.jenkins@googlemail.com> Subject: Re: How to get libiconv on FreeBSD 10 convert utf-8 -> wchar_t ? Message-ID: <20151013115346.191326b2@kalimero.tijl.coosemans.org> In-Reply-To: <1444728578150-6044683.post@n5.nabble.com> References: <1443688672992-6042436.post@n5.nabble.com> <20151001212047.1f79e315@kalimero.tijl.coosemans.org> <1444723053047-6044663.post@n5.nabble.com> <1444728578150-6044683.post@n5.nabble.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 13 Oct 2015 02:29:38 -0700 (MST) kora via freebsd-questions <freebsd-questions@freebsd.org> wrote: > Hi there, > I solved it. > I didn't notice that wchar_t is system dependent ! > > I wrote a helpermethod to return the correct wchar_t "tocode" / "fromcode" > input for the iconv_open(). > Using it now works. > > > #define WCHAR_32_LE "UTF-32LE" > #define WCHAR_32_BE "UTF-32BE" > #define WCHAR_16_LE "UTF-16LE" > #define WCHAR_16_BE "UTF-16BE" Yes, FreeBSD wchar_t is not UTF-32. If you are using UTF-32 now be aware that functions like wprintf may not work. You may want to use char32_t instead of wchar_t to prevent programming errors.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151013115346.191326b2>