X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=lib%2Funicodeio.c;h=37b69aaa01cae1f5b9f3fcf379a481afc57aed14;hb=61170ee8403ead856956207fef048e6eae3563ed;hp=4300df556e0fb7fc1dc941bb08ea055e07b8b392;hpb=1b10ab140fdb1184462b2e302560f430bcec7f38;p=chaz%2Ftar diff --git a/lib/unicodeio.c b/lib/unicodeio.c index 4300df5..37b69aa 100644 --- a/lib/unicodeio.c +++ b/lib/unicodeio.c @@ -48,6 +48,10 @@ extern int errno; # include #endif +#if HAVE_LANGINFO_CODESET && ! USE_INCLUDED_LIBINTL +# include +#endif + #include "unicodeio.h" /* When we pass a Unicode character to iconv(), we must pass it in a @@ -126,8 +130,18 @@ unicode_to_mb (unsigned int code, if (!initialized) { + const char *charset; + +#if USE_INCLUDED_LIBINTL extern const char *locale_charset PARAMS ((void)); - const char *charset = locale_charset (); + charset = locale_charset (); +#else +# if HAVE_LANGINFO_CODESET + charset = nl_langinfo (CODESET); +# else + charset = ""; +# endif +#endif is_utf8 = !strcmp (charset, UTF8_NAME); #if HAVE_ICONV