Havoc Pennington's implementation of convenient character set conversion

Sun Sep 10 12:37:40 2000  Owen Taylor  <otaylor@redhat.com>

	* glib.h gconvert.c (g_convert): Havoc Pennington's implementation
	of convenient character set conversion using iconv, with
	the addition of GError. We probably need a fallback that
	just does conversions between, say UTF-8,16,32 and ISO-8859-1
	for targets without iconv at all.

	Also add g_convert_with_fallback() to take care of conversions
	where we accept some loss going to the target encoding.
This commit is contained in:
Owen Taylor
2000-09-11 03:03:18 +00:00
committed by Owen Taylor
parent 49c937fcbb
commit a212f93df2
14 changed files with 934 additions and 0 deletions

View File

@@ -3403,6 +3403,32 @@ guint g_thread_pool_get_num_unused_threads (void);
/* Stop all currently unused threads, but leave the limit untouched */
void g_thread_pool_stop_unused_threads (void);
typedef enum
{
G_CONVERT_ERROR_NO_CONVERSION,
G_CONVERT_ERROR_ILLEGAL_SEQUENCE,
G_CONVERT_ERROR_OTHER
} GConvertError;
#define G_CONVERT_ERROR g_convert_error_quark()
GQuark g_convert_error_quark();
gchar* g_convert (const gchar *str,
gint len,
const gchar *to_codeset,
const gchar *from_codeset,
gint *bytes_read,
gint *bytes_written,
GError **error);
gchar* g_convert_with_fallback (const gchar *str,
gint len,
const gchar *to_codeset,
const gchar *from_codeset,
gchar *fallback,
gint *bytes_read,
gint *bytes_written,
GError **error);
#ifdef __cplusplus
}
#endif /* __cplusplus */