Use locale_charset (from libcharset) instead of nl_langinfo directly.
authorPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 13 Oct 2002 14:19:38 +0000 (14:19 +0000)
committerPeter Verthez <Peter.Verthez@advalvas.be>
Sun, 13 Oct 2002 14:19:38 +0000 (14:19 +0000)
utf8/utf8-locale.c

index 1b3e255cc6fb062ca0d9b69ed51f3446d3cc5025..058ef1801838838de1e040257b5679cf18279467 100644 (file)
 
 #include <stdlib.h>
 #include <iconv.h>
-#include <langinfo.h>
 #include <assert.h>
 #include <errno.h>
 #include "config.h"
+#include "libcharset.h"
 #include "utf8-locale.h"
 
 #define INITIAL_OUTSIZE 256
@@ -43,11 +43,11 @@ int open_conversion_contexts()
 {
   assert(utf8_to_locale == (iconv_t) -1);
   assert(locale_to_utf8 == (iconv_t) -1);
-  utf8_to_locale = iconv_open(nl_langinfo(CODESET), "UTF-8");
+  utf8_to_locale = iconv_open(locale_charset(), "UTF-8");
   if (utf8_to_locale == (iconv_t) -1)
     return -1;
   else {
-    locale_to_utf8 = iconv_open("UTF-8", nl_langinfo(CODESET));
+    locale_to_utf8 = iconv_open("UTF-8", locale_charset());
     if (locale_to_utf8 == (iconv_t) -1) {
       close_conversion_contexts();
       return -1;