This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
iconv problem
- From: Tobias Hunger <tobias at fresco dot org>
- To: libc-alpha at sources dot redhat dot com
- Date: Wed, 30 Oct 2002 01:34:18 +0100
- Subject: iconv problem
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
I wrote a little program using iconv that tries to get the first UTF32
character from a sequence of UTF8 encoded input values (more then one
character long),
I do
cd = iconv_open("UTF32", "UTF8");
The Inbuf contains a pointer to a 11 byte long char *, inbuf_bound is 11 byte,
outbuf is a char * to a 4 byte long (zeroed out) output area, outbuf_bound is
4.
After calling
retval = iconv(cd, &in_buf, &in_bound, &out_buf, &out_bound);
retval is -1, errno == E2BIG, out_buf_bound is 0, all as expected. But
inbuf_bound is still 11 and out_buf contains a value of 65279. Is that what
is supposed to happen? Why got out_buf written into but in_bound not
decremented accordingly?
- --
Gruss,
Tobias
- ------------------------------------------------------------
Tobias Hunger The box said: 'Windows 95 or better'
tobias@fresco.org So I installed Linux.
- ------------------------------------------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE9vykTv0FZW3NyoqURAokkAJ4wDX3py899xgEItk0qxpWuehEASgCgrzRl
RrREdP1h47fCXtq4CMUPFpM=
=rsSm
-----END PGP SIGNATURE-----