* charset.c (iconv_open): Use UTF-16 and UTF-32, not UCS-2 and
	UCS-4.
	(iconv): Rename 'ucs_flag'.
	(GDB_DEFAULT_TARGET_WIDE_CHARSET): Use UTF-32.
	* c-lang.c (charset_for_string_type): Use UTF-16 and UTF-32, not
	UCS-2 and UCS-4.
	(convert_ucn): Use UTF-32.
gdb/testsuite
	* gdb.base/charset.exp: Use UTF-16 and UTF-32, not UCS-2 and
	UCS-4.
	* gdb.base/charset.c (utf_32_string): Rename.
	(init_utf32): Rename.
	(main): Update.
This commit is contained in:
Tom Tromey
2009-09-25 20:53:14 +00:00
parent fe2d172ccb
commit b8899f2b68
6 changed files with 51 additions and 33 deletions

View File

@@ -102,17 +102,17 @@
iconv_t
iconv_open (const char *to, const char *from)
{
/* We allow conversions from UCS-4BE, wchar_t, and the host charset.
/* We allow conversions from UTF-32BE, wchar_t, and the host charset.
We allow conversions to wchar_t and the host charset. */
if (strcmp (from, "UCS-4BE") && strcmp (from, "wchar_t")
if (strcmp (from, "UTF-32BE") && strcmp (from, "wchar_t")
&& strcmp (from, GDB_DEFAULT_HOST_CHARSET))
return -1;
if (strcmp (to, "wchar_t") && strcmp (to, GDB_DEFAULT_HOST_CHARSET))
return -1;
/* Return 1 if we are converting from UCS-4BE, 0 otherwise. This is
/* Return 1 if we are converting from UTF-32BE, 0 otherwise. This is
used as a flag in calls to iconv. */
return !strcmp (from, "UCS-4BE");
return !strcmp (from, "UTF-32BE");
}
int
@@ -122,10 +122,10 @@ iconv_close (iconv_t arg)
}
size_t
iconv (iconv_t ucs_flag, const char **inbuf, size_t *inbytesleft,
iconv (iconv_t utf_flag, const char **inbuf, size_t *inbytesleft,
char **outbuf, size_t *outbytesleft)
{
if (ucs_flag)
if (utf_flag)
{
while (*inbytesleft >= 4)
{
@@ -193,7 +193,7 @@ iconv (iconv_t ucs_flag, const char **inbuf, size_t *inbytesleft,
#endif
#ifndef GDB_DEFAULT_TARGET_WIDE_CHARSET
#define GDB_DEFAULT_TARGET_WIDE_CHARSET "UCS-4"
#define GDB_DEFAULT_TARGET_WIDE_CHARSET "UTF-32"
#endif
static const char *auto_host_charset_name = GDB_DEFAULT_HOST_CHARSET;