]> Dogcows Code - chaz/tar/blobdiff - lib/unicodeio.c
Don't assume we're using the included libintl.
[chaz/tar] / lib / unicodeio.c
index 3a5448f059791a625a812189282f20832219eaf1..37b69aaa01cae1f5b9f3fcf379a481afc57aed14 100644 (file)
@@ -48,11 +48,8 @@ extern int errno;
 # include <iconv.h>
 #endif
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
+#if HAVE_LANGINFO_CODESET && ! USE_INCLUDED_LIBINTL
+# include <langinfo.h>
 #endif
 
 #include "unicodeio.h"
@@ -133,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
This page took 0.023809 seconds and 4 git commands to generate.