9 const char *dummy_codesets
[] =
11 "ISO_8859-1", "ISO_8859-2", "ISO_8859-3", "ISO_8859-4",
12 "ISO_8859-5", "ISO_8859-6", "ISO_8859-7", "ISO_8859-8"
14 iconv_t dummy_cd
[8], cd_a
;
16 char buffer
[1024], *to
= buffer
;
17 char *from
= (char *) "foobar";
18 size_t to_left
= 1024, from_left
= 6;
20 /* load dummy modules */
21 for (i
= 0; i
< 8; i
++)
22 if ((dummy_cd
[i
] = iconv_open (dummy_codesets
[i
], "UTF8")) == (iconv_t
) -1)
25 /* load a module... */
26 if ((cd_a
= iconv_open ("EUC-JP", "UTF8")) == (iconv_t
) -1)
28 /* and close it once. we'll reload this later */
31 /* unload dummy modules */
32 for (i
= 0; i
< 8; i
++)
33 iconv_close (dummy_cd
[i
]);
35 /* load the module again */
36 if ((cd_a
= iconv_open ("EUC-JP", "UTF8")) == (iconv_t
) -1)
39 puts ("This used to crash");
40 printf ("%zd\n", iconv (cd_a
, &from
, &from_left
, &to
, &to_left
));