1 /* Contributed by Owen Taylor <otaylor@redhat.com>. */
11 main (int argc
, char *argv
[])
14 wchar_t outbuf
[BUFSIZE
];
20 size_t inbytes_left
, outbytes_left
;
24 for (i
=0; i
< BUFSIZE
; i
++)
27 cd
= iconv_open ("UCS-4LE", "UTF-8");
29 inbytes_left
= BUFSIZE
;
30 outbytes_left
= BUFSIZE
* 4;
32 outptr
= (char *) outbuf
;
34 count
= iconv (cd
, &inptr
, &inbytes_left
, &outptr
, &outbytes_left
);
39 printf ("Received E2BIG\n");
41 printf ("Received something else\n");
43 printf ("inptr change: %td\n", inptr
- inbuf
);
44 printf ("inlen change: %d\n", BUFSIZE
- inbytes_left
);
45 printf ("outptr change: %zd\n", outptr
- (char *) outbuf
);
46 printf ("outlen change: %d\n", BUFSIZE
* 4 - outbytes_left
);
50 printf ("Succeeded\n");