mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
Move g_get_codeset next to g_get_charset
g_get_codeset is a close relatove to g_get_charset, and up to now it lived a shadowy existence without any header presence.
This commit is contained in:
parent
976b0b72a4
commit
d0bb1e0b0a
@ -2666,6 +2666,7 @@ GConvertError
|
||||
|
||||
<SUBSECTION>
|
||||
g_get_charset
|
||||
g_get_codeset
|
||||
|
||||
<SUBSECTION Private>
|
||||
g_convert_error_quark
|
||||
|
@ -489,13 +489,8 @@ typedef enum
|
||||
guint32 g_unicode_script_to_iso15924 (GUnicodeScript script);
|
||||
GUnicodeScript g_unicode_script_from_iso15924 (guint32 iso15924);
|
||||
|
||||
/* 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, 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 (const char **charset);
|
||||
gchar * g_get_codeset (void);
|
||||
|
||||
/* These are all analogs of the <ctype.h> functions.
|
||||
*/
|
||||
|
20
glib/gutf8.c
20
glib/gutf8.c
@ -583,7 +583,7 @@ charset_cache_free (gpointer data)
|
||||
* freed.
|
||||
*
|
||||
* Return value: %TRUE if the returned charset is UTF-8
|
||||
**/
|
||||
*/
|
||||
gboolean
|
||||
g_get_charset (const char **charset)
|
||||
{
|
||||
@ -618,6 +618,24 @@ g_get_charset (const char **charset)
|
||||
return cache->is_utf8;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_get_codeset:
|
||||
*
|
||||
* Gets the character set for the current locale.
|
||||
*
|
||||
* Return value: a newly allocated string containing the name
|
||||
* of the character set. This string must be freed with g_free().
|
||||
*/
|
||||
gchar *
|
||||
g_get_codeset (void)
|
||||
{
|
||||
const gchar *charset;
|
||||
|
||||
g_get_charset (&charset);
|
||||
|
||||
return g_strdup (charset);
|
||||
}
|
||||
|
||||
/* unicode_strchr */
|
||||
|
||||
/**
|
||||
|
@ -2955,24 +2955,6 @@ g_nullify_pointer (gpointer *nullify_location)
|
||||
*nullify_location = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* g_get_codeset:
|
||||
*
|
||||
* Get the codeset for the current locale.
|
||||
*
|
||||
* Return value: a newly allocated string containing the name
|
||||
* of the codeset. This string must be freed with g_free().
|
||||
**/
|
||||
gchar *
|
||||
g_get_codeset (void)
|
||||
{
|
||||
const gchar *charset;
|
||||
|
||||
g_get_charset (&charset);
|
||||
|
||||
return g_strdup (charset);
|
||||
}
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user