diff options
author | Arnavion <arnavion@gmail.com> | 2015-01-31 00:52:31 -0800 |
---|---|---|
committer | Arnavion <arnavion@gmail.com> | 2015-01-31 00:52:31 -0800 |
commit | 1d83610341777ec723f4619b168b1001a8b109ab (patch) | |
tree | 71a8e833e89bcbb370d90334e279563bfcba2491 /src/common/text.h | |
parent | 5dde0d7c6d703a6797cbe3af8aa548ba23a1a024 (diff) |
Save iconv converters for input and output in the server.
These are then used with g_convert_with_iconv instead of making it create a new iconv converter every time for the given from-to-encoding pairs.
Diffstat (limited to 'src/common/text.h')
-rw-r--r-- | src/common/text.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/common/text.h b/src/common/text.h index 4f47815d..28fc0c0d 100644 --- a/src/common/text.h +++ b/src/common/text.h @@ -57,12 +57,15 @@ void text_emit (int index, session *sess, char *a, char *b, char *c, char *d, time_t timestamp); int text_emit_by_name (char *name, session *sess, time_t timestamp, char *a, char *b, char *c, char *d); -gchar *text_invalid_utf8_to_encoding (const gchar* text, gssize len, const gchar *to_encoding, gsize *len_out); -gchar *text_invalid_encoding_to_utf8 (const gchar* text, gssize len, const gchar *from_encoding, gsize *len_out); +gchar *text_convert_invalid (const gchar* text, gssize len, GIConv converter, const gchar *fallback, gsize *len_out); +gchar *text_fixup_invalid_utf8 (const gchar* text, gssize len, gsize *len_out); int get_stamp_str (char *fmt, time_t tim, char **ret); void format_event (session *sess, int index, char **args, char *o, gsize sizeofo, unsigned int stripcolor_args); char *text_find_format_string (char *name); - + +extern const gchar* unicode_fallback_string; +extern const gchar* arbitrary_encoding_fallback_string; + void sound_play (const char *file, gboolean quiet); void sound_play_event (int i); void sound_beep (session *); |