-#if __STDC_ISO_10646__ && HAVE_WCRTOMB
-
-/* Values of type wchar_t are Unicode code points. */
-
-/* Outputs the Unicode character CODE to the output stream STREAM.
- Assumes that the locale doesn't change between two calls. */
-void
-print_unicode_char (FILE *stream, unsigned int code)
-{
- wchar_t wc = (wchar_t) code;
-
- /* Test for truncation. */
- if (wc == code)
- {
- /* Convert from wide character to multibyte representation. */
- char buf[64]; /* Assume MB_LEN_MAX <= 64. */
- mbstate_t state;
- size_t res;
-
- memset (&state, 0, sizeof (mbstate_t));
- res = wcrtomb (buf, wc, &state);
- if (res != (size_t)(-1))
- fwrite (buf, 1, res, stream);
- else
- error (1, errno,
- _("cannot convert U+%04X to local character set"), code);
- }
- else
- error (1, 0, _("cannot convert U+%04X to local character set"), code);
-}
-
-#else
-