#include <unicode-data.h>
#include <errno.h>
-#if defined(_MSC_VER) || defined(G_OS_WIN32)
-/* FIXME */
-# define CODESET 1
-# include <windows.h>
-#else
+#ifndef G_OS_WIN32
# ifdef HAVE_LOCALCHARSET_H
# include <localcharset.h>
# endif
#endif
-static const char *my_charset;
-static gboolean is_utf8;
+const char *my_charset;
/*
* Character set conversion
return res;
}
+#ifndef G_OS_WIN32
+static gboolean is_utf8;
+
gboolean
g_get_charset (G_CONST_RETURN char **charset)
{
if (my_charset == NULL) {
-#ifdef G_OS_WIN32
- static char buf [14];
- sprintf (buf, "CP%u", GetACP ());
- my_charset = buf;
- is_utf8 = FALSE;
-#else
/* These shouldn't be heap allocated */
#if defined(HAVE_LOCALCHARSET_H)
my_charset = locale_charset ();
my_charset = "UTF-8";
#endif
is_utf8 = strcmp (my_charset, "UTF-8") == 0;
-#endif
}
if (charset != NULL)
return is_utf8;
}
+#endif /* G_OS_WIN32 */
gchar *
g_locale_to_utf8 (const gchar *opsysstring, gssize len, gsize *bytes_read, gsize *bytes_written, GError **error)