diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-09-11 03:03:18 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-09-11 03:03:18 +0000 |
commit | a212f93df26c24dc724905555b9525fe455be863 (patch) | |
tree | fc9bd6ad70eeeac3e9ea5384681eb1a7093c19c6 /glib.h | |
parent | 49c937fcbb0add57ab215c0c65ba3a02e6fb13c9 (diff) | |
download | glib-a212f93df26c24dc724905555b9525fe455be863.tar.gz |
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.
Diffstat (limited to 'glib.h')
-rw-r--r-- | glib.h | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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 */ |