Add some GNU libiconv compatibility: Recognize "" and "char" as aliases

2008-02-29  Tor Lillqvist  <tml@novell.com>

	* glib/win_iconv.c (name_to_codepage): Add some GNU libiconv
	compatibility: Recognize "" and "char" as aliases for the current
	locale's charset. (We use the system ANSI codepage as returned by
	GetACP().) Recognize "wchar_t" as an alias for UTF-16LE.


svn path=/trunk/; revision=6604
This commit is contained in:
Tor Lillqvist 2008-02-28 22:59:39 +00:00 committed by Tor Lillqvist
parent 138c2826f0
commit 7d48fb3c81
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2008-02-29 Tor Lillqvist <tml@novell.com>
* glib/win_iconv.c (name_to_codepage): Add some GNU libiconv
compatibility: Recognize "" and "char" as aliases for the current
locale's charset. (We use the system ANSI codepage as returned by
GetACP().) Recognize "wchar_t" as an alias for UTF-16LE.
2008-02-27 Matthew Barnes <mbarnes@redhat.com>
* glib/gchecksum.[ch] (g_checksum_update),

View File

@ -953,7 +953,12 @@ name_to_codepage(const char *name)
{
int i;
if (_strnicmp(name, "cp", 2) == 0)
if (*name == '\0' ||
strcmp(name, "char") == 0)
return GetACP();
else if (strcmp(name, "wchar_t") == 0)
return 1200;
else if (_strnicmp(name, "cp", 2) == 0)
return atoi(name + 2); /* CP123 */
else if ('0' <= name[0] && name[0] <= '9')
return atoi(name); /* 123 */