1 // Derived from BZ #9793
10 iconv_t cd = iconv_open ("ASCII//TRANSLIT", "UTF-8");
11 if (cd == (iconv_t) -1)
13 puts ("iconv_open failed");
17 char input[2] = { 0xc2, 0xae }; /* Registered trademark */
19 size_t insize = sizeof (input);
20 char output[2]; /* Too short to contain "(R)". */
21 char *outptr = output;
22 size_t outsize = sizeof (output);
24 size_t ret = iconv (cd, &inptr, &insize, &outptr, &outsize);
25 if (ret != (size_t) -1)
27 puts ("iconv succeeded");
32 puts ("iconv did not set errno to E2BIG");
38 puts ("inptr changed");
41 if (insize != sizeof (input))
43 puts ("insize changed");
48 puts ("outptr changed");
51 if (outsize != sizeof (output))
53 puts ("outsize changed");
56 if (iconv_close (cd) == -1)
58 puts ("iconv_close failed");
64 #define TEST_FUNCTION do_test ()
65 #include "../test-skeleton.c"