[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] Struggling to use iconv() for UTF-8 to UTF-32 - s
From: |
Bruno Haible |
Subject: |
Re: [bug-gnu-libiconv] Struggling to use iconv() for UTF-8 to UTF-32 - sample code? |
Date: |
Sun, 24 Aug 2008 03:26:10 +0200 |
User-agent: |
KMail/1.5.4 |
Hi,
David Bruce wrote:
> Can anyone point me to a working C example of the use of GNU iconv()
> to convert UTF-8 to UTF-32? I haven't got it to work from studying
> the manual nor have I found an example with Google.
The sample code in libiconv/extras/iconv_string.[hc] should also work
fine with fromcode = "UTF-8" and tocode = "UTF-32".
However, not all systems' iconv supports "UTF-32" (GNU libiconv and
glibc's iconv support it, of course). If you're after portability, you
can also use the special-purpose conversion routine in the gnulib module
'unistr/u8-to-u32':
http://www.gnu.org/software/gnulib/MODULES.html#module=unistr/u8-to-u32
Bruno