glib r6552 - in branches/glib-2-14: . docs/reference docs/reference/glib glib
- From: tml svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r6552 - in branches/glib-2-14: . docs/reference docs/reference/glib glib
- Date: Thu, 21 Feb 2008 13:14:04 +0000 (GMT)
Author: tml
Date: Thu Feb 21 13:14:03 2008
New Revision: 6552
URL: http://svn.gnome.org/viewvc/glib?rev=6552&view=rev
Log:
2008-02-21 Tor Lillqvist <tml novell com>
* glib/gutf8.c (g_get_charset)
* glib/gconvert.c (g_locale_from_utf8)
* docs/reference/glib/running.sgml: Clarify character set
issues on Windows.
Modified:
branches/glib-2-14/ChangeLog
branches/glib-2-14/docs/reference/ChangeLog
branches/glib-2-14/docs/reference/glib/running.sgml
branches/glib-2-14/glib/gconvert.c
branches/glib-2-14/glib/gutf8.c
Modified: branches/glib-2-14/docs/reference/glib/running.sgml
==============================================================================
--- branches/glib-2-14/docs/reference/glib/running.sgml (original)
+++ branches/glib-2-14/docs/reference/glib/running.sgml Thu Feb 21 13:14:03 2008
@@ -214,6 +214,22 @@
locale.
</para>
+<para>
+On Windows, in a C program there are several locale concepts
+that not necessarily are synchronized. On one hand, there is the
+system default ANSI code-page, which determines what encoding is used
+for file names handled by the C library's functions and the Win32
+API. (We are talking about the "narrow" functions here that take
+character pointers, not the "wide" ones.)
+</para>
+
+<para>
+On the other hand, there is the C library's current locale. The
+character set (code-page) used by that is not necessarily the same as
+the system default ANSI code-page. Strings in this character set are
+returned by functions like <function>strftime</function>.
+</para>
+
</refsect2>
<refsect2>
Modified: branches/glib-2-14/glib/gconvert.c
==============================================================================
--- branches/glib-2-14/glib/gconvert.c (original)
+++ branches/glib-2-14/glib/gconvert.c Thu Feb 21 13:14:03 2008
@@ -1091,7 +1091,8 @@
*
* Converts a string from UTF-8 to the encoding used for strings by
* the C runtime (usually the same as that used by the operating
- * system) in the <link linkend="setlocale">current locale</link>.
+ * system) in the <link linkend="setlocale">current locale</link>. On
+ * Windows this means the system codepage.
*
* Return value: The converted string, or %NULL on an error.
**/
Modified: branches/glib-2-14/glib/gutf8.c
==============================================================================
--- branches/glib-2-14/glib/gutf8.c (original)
+++ branches/glib-2-14/glib/gutf8.c Thu Feb 21 13:14:03 2008
@@ -510,6 +510,12 @@
* other encoding. (Frequently g_locale_to_utf8() and g_locale_from_utf8()
* are nice shortcuts, though.)
*
+ * On Windows the character set returned by this function is the
+ * so-called system default ANSI code-page. That is the character set
+ * used by the "narrow" versions of C library and Win32 functions that
+ * handle file names. It might be different from the character set
+ * used by the C library's current locale.
+ *
* The return value is %TRUE if the locale's encoding is UTF-8, in that
* case you can perhaps avoid calling g_convert().
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]