This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]