+ /* Find out how many bytes there are in a null char in the target
+ encoding */
+ iconv_t bconv = iconv_open (tocode, "ASCII");
+ if (bconv != (iconv_t) -1)
+ {
+ ICONV_CONST char *nullstr = strdup ("");
+ ICONV_CONST char *outbuf = strdup ("XXXXXXXX");
+ ICONV_CONST char *snullstr = nullstr;
+ ICONV_CONST char *soutbuf = outbuf;
+
+ size_t inbytes = 1;
+ const size_t bytes = 8;
+ size_t outbytes = bytes;
+ if (-1 != iconv (bconv, &nullstr, &inbytes, &outbuf, &outbytes))
+ converter->null_char_width = bytes - outbytes;
+ free (snullstr);
+ free (soutbuf);
+ iconv_close (bconv);
+ }
+
+ hmapx_insert (&map, converter, hash);
+
+ return converter;