9 iconv_t cd
= iconv_open ("utf-8", "unicode");
10 if (cd
== (iconv_t
) -1)
12 puts ("cannot open iconv module");
16 static const uint16_t us
[] = { 0xfeff, 0x0041, 0x0042, 0x0043 };
28 outlen
= sizeof (buf
);
29 n
= iconv (cd
, &inbuf
, &inlen
, &outbuf
, &outlen
);
30 if (n
== (size_t) -1 || inlen
!= 0 || outlen
!= sizeof (buf
) - 3)
32 puts ("first conversion failed");
36 iconv (cd
, NULL
, NULL
, NULL
, NULL
);
41 outlen
= sizeof (buf
);
42 n
= iconv (cd
, &inbuf
, &inlen
, &outbuf
, &outlen
);
43 if (n
== (size_t) -1 || inlen
!= 0 || outlen
!= sizeof (buf
) - 3)
45 puts ("second conversion failed");
52 #define TEST_FUNCTION do_test ()
53 #include "../test-skeleton.c"