+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
+2000-12-17 Tor Lillqvist <tml@iki.fi>
+
+ * gutf8.c (g_utf8_get_charset_internal): (Win32) Use GetACP to get
+ the current ANSI codepage.
+
+ * gunicode.h: Add comment that the static string g_get_charset
+ sets the parameter to point to should be copied in case the
+ charset might be changed later in the program.
+
2000-12-14 Tor Lillqvist <tml@iki.fi>
* makefile.{mingw,msc}.in: No need to -DGSPAWN_HELPER when
/* Returns TRUE if current locale uses UTF-8 charset. If CHARSET is
* not null, sets *CHARSET to the name of the current locale's
- * charset. This value is statically allocated.
+ * charset. This value is statically allocated, and should be copied
+ * in case the locale's charset will be changed later using setlocale()
+ * or in some other way.
*/
gboolean g_get_charset (char **charset);
#include "glib.h"
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
+
#define UTF8_COMPUTE(Char, Mask, Len) \
if (Char < 128) \
{ \
}
#endif
+#ifdef G_OS_WIN32
+ if (a && ! *a)
+ {
+ static char codepage[10];
+
+ sprintf (codepage, "CP%d", GetACP ());
+ *a = codepage;
+ /* What about codepage 1200? Is that UTF-8? */
+ return FALSE;
+ }
+#else
if (a && ! *a)
*a = "US-ASCII";
+#endif
+
/* Assume this for compatibility at present. */
return FALSE;
}
g_param_value_set_default
g_param_value_validate
g_param_values_cmp
- g_signal_add_emission_hook_full
g_signal_connect_closure
g_signal_connect_closure_by_id
g_signal_connect_data
g_signal_new_valist
g_signal_parse_name
g_signal_query
- g_signal_remove_emission_hook
g_signal_stop_emission
g_signal_type_cclosure_new
g_type_add_class_cache_func
/* Returns TRUE if current locale uses UTF-8 charset. If CHARSET is
* not null, sets *CHARSET to the name of the current locale's
- * charset. This value is statically allocated.
+ * charset. This value is statically allocated, and should be copied
+ * in case the locale's charset will be changed later using setlocale()
+ * or in some other way.
*/
gboolean g_get_charset (char **charset);
#include "glib.h"
+#ifdef G_OS_WIN32
+#include <windows.h>
+#endif
+
#define UTF8_COMPUTE(Char, Mask, Len) \
if (Char < 128) \
{ \
}
#endif
+#ifdef G_OS_WIN32
+ if (a && ! *a)
+ {
+ static char codepage[10];
+
+ sprintf (codepage, "CP%d", GetACP ());
+ *a = codepage;
+ /* What about codepage 1200? Is that UTF-8? */
+ return FALSE;
+ }
+#else
if (a && ! *a)
*a = "US-ASCII";
+#endif
+
/* Assume this for compatibility at present. */
return FALSE;
}