]> Dogcows Code - chaz/tar/blobdiff - lib/unicodeio.c
know -> known
[chaz/tar] / lib / unicodeio.c
index 3a5448f059791a625a812189282f20832219eaf1..a1db6e282dd8828f5f79b8355dbb39abd7d1291f 100644 (file)
 #ifndef errno
 extern int errno;
 #endif
+
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+/* Some systems, like SunOS 4, don't have EILSEQ.  On these systems,
+   define EILSEQ to some value other than EINVAL, because our invokers
+   may want to distinguish EINVAL from EILSEQ.  */
 #ifndef EILSEQ
-# define EILSEQ EINVAL
+# define EILSEQ ENOENT
 #endif
 #ifndef ENOTSUP
 # define ENOTSUP EINVAL
 #endif
 
-#if HAVE_ICONV
-# 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 +134,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.02003 seconds and 4 git commands to generate.