diff options
author | Berke Viktor <bviktor@hexchat.org> | 2013-03-15 22:00:55 +0100 |
---|---|---|
committer | Berke Viktor <bviktor@hexchat.org> | 2013-03-15 22:00:55 +0100 |
commit | 25f8e45b73c8ce685e5591a75ad1b3d69828fde8 (patch) | |
tree | c483fa1034e68f518c8df12cd6dd9b7c7a18a6c9 /src/common | |
parent | 16cc178ba0e5642f372efb6a991c1d9501ad6777 (diff) |
Get rid of Non-BMP filtering, Pango handles this now
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/server.c | 24 | ||||
-rw-r--r-- | src/common/text.c | 81 | ||||
-rw-r--r-- | src/common/text.h | 6 |
3 files changed, 2 insertions, 109 deletions
diff --git a/src/common/server.c b/src/common/server.c index 6ddaa18d..42cae85f 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -313,13 +313,6 @@ server_inline (server *serv, char *line, int len) { char *utf_line_allocated = NULL; -#ifdef WIN32 -#if 0 - char *cleaned_line; - int cleaned_len; -#endif -#endif - /* Checks whether we're set to use UTF-8 charset */ if (serv->using_irc || /* 1. using CP1252/UTF-8 Hybrid */ (serv->encoding == NULL && prefs.utf8_locale) || /* OR 2. using system default->UTF-8 */ @@ -406,28 +399,11 @@ server_inline (server *serv, char *line, int len) } } -#ifdef WIN32 -#if 0 - cleaned_line = text_replace_non_bmp (line, len, &cleaned_len); - if (cleaned_line != NULL ) { - line = cleaned_line; - len = cleaned_len; - } -#endif - text_replace_non_bmp2 (line); -#endif - fe_add_rawlog (serv, line, len, FALSE); /* let proto-irc.c handle it */ serv->p_inline (serv, line, len); -#ifdef WIN32 -#if 0 - g_free (cleaned_line); -#endif -#endif - if (utf_line_allocated != NULL) /* only if a special copy was allocated */ g_free (utf_line_allocated); } diff --git a/src/common/text.c b/src/common/text.c index 0bef377c..5c4fb3ca 100644 --- a/src/common/text.c +++ b/src/common/text.c @@ -307,21 +307,9 @@ scrollback_load (session *sess) { text = strip_color (text + 1, -1, STRIP_COLOR); } -#ifdef WIN32 -#if 0 - cleaned_text = text_replace_non_bmp (text, -1, &cleaned_len); - if (cleaned_text != NULL) - { - if (prefs.hex_text_stripcolor_replay) - { - g_free (text); - } - text = cleaned_text; - } -#endif - text_replace_non_bmp2 (text); -#endif + fe_print_text (sess, text, stamp); + if (prefs.hex_text_stripcolor_replay) { g_free (text); @@ -833,71 +821,6 @@ iso_8859_1_to_utf8 (unsigned char *text, int len, gsize *bytes_written) return res; } -#ifdef WIN32 -/* replace characters outside of the Basic Multilingual Plane with - * replacement characters (0xFFFD) */ -#if 0 -char * -text_replace_non_bmp (char *utf8_input, int input_length, glong *output_length) -{ - gunichar *ucs4_text; - gunichar suspect; - gchar *utf8_text; - glong ucs4_length; - glong index; - - ucs4_text = g_utf8_to_ucs4_fast (utf8_input, input_length, &ucs4_length); - - /* replace anything not in the Basic Multilingual Plane - * (code points above 0xFFFF) with the replacement - * character */ - for (index = 0; index < ucs4_length; index++) - { - suspect = ucs4_text[index]; - if ((suspect >= 0x1D173 && suspect <= 0x1D17A) - || (suspect >= 0xE0001 && suspect <= 0xE007F)) - { - ucs4_text[index] = 0xFFFD; /* replacement character */ - } - } - - utf8_text = g_ucs4_to_utf8 ( - ucs4_text, - ucs4_length, - NULL, - output_length, - NULL - ); - g_free (ucs4_text); - - return utf8_text; -} -#endif - -void -text_replace_non_bmp2 (char *utf8_input) -{ - char *tmp = utf8_input, *next; - gunichar suspect; - - while (tmp != NULL && *tmp) - { - next = g_utf8_next_char(tmp); - suspect = g_utf8_get_char_validated(tmp, next - tmp); - if ((suspect >= 0x1D173 && suspect <= 0x1D17A) || (suspect >= 0xE0001 && suspect <= 0xE007F)) - { - /* 0xFFFD - replacement character */ - *tmp = 0xEF; - *(++tmp) = 0xBF; - *(++tmp) = 0xBD; - *(++tmp) = 0x1A; /* ASCII Sub to fill the 4th non-BMP byte */ - } - - tmp = next; - } -} -#endif - char * text_validate (char **text, int *len) { diff --git a/src/common/text.h b/src/common/text.h index ccbae785..c3adb885 100644 --- a/src/common/text.h +++ b/src/common/text.h @@ -28,12 +28,6 @@ int pevent_load (char *filename); void pevent_make_pntevts (void); void text_emit (int index, session *sess, char *a, char *b, char *c, char *d); int text_emit_by_name (char *name, session *sess, char *a, char *b, char *c, char *d); -#ifdef WIN32 -#if 0 -char *text_replace_non_bmp (char *utf8_input, int input_length, glong *output_length); -#endif -void text_replace_non_bmp2 (char *utf8_input); -#endif char *text_validate (char **text, int *len); int get_stamp_str (char *fmt, time_t tim, char **ret); void format_event (session *sess, int index, char **args, char *o, int sizeofo, unsigned int stripcolor_args); |