From 2e76a4e4774fe867bf717f8511f2e60deea5b260 Mon Sep 17 00:00:00 2001 From: Arnavion Date: Sun, 18 Jan 2015 02:10:03 -0800 Subject: [PATCH] Removed CP1255-specific handling of server lines. GLib's API is good enough now. --- src/common/dcc.c | 5 ----- src/common/hexchat.h | 1 - src/common/server.c | 10 ++-------- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/common/dcc.c b/src/common/dcc.c index e44438a5..b48bd3a8 100644 --- a/src/common/dcc.c +++ b/src/common/dcc.c @@ -514,8 +514,6 @@ dcc_chat_line (struct DCC *dcc, char *line) message_tags_data no_tags = MESSAGE_TAGS_DATA_INIT; len = strlen (line); - if (dcc->serv->using_cp1255) - len++; /* include the NUL terminator */ if (dcc->serv->encoding == NULL) /* system */ utf = g_locale_to_utf8 (line, len, NULL, &utf_len, NULL); @@ -528,9 +526,6 @@ dcc_chat_line (struct DCC *dcc, char *line) len = utf_len; } - if (dcc->serv->using_cp1255 && len > 0) - len--; - /* we really need valid UTF-8 now */ conv = text_validate (&line, &len); diff --git a/src/common/hexchat.h b/src/common/hexchat.h index 4bc6eb20..1d4e4f1f 100644 --- a/src/common/hexchat.h +++ b/src/common/hexchat.h @@ -567,7 +567,6 @@ typedef struct server unsigned int have_except:1; /* ban exemptions +e */ unsigned int have_invite:1; /* invite exemptions +I */ unsigned int have_cert:1; /* have loaded a cert */ - unsigned int using_cp1255:1; /* encoding is CP1255/WINDOWS-1255? */ unsigned int use_who:1; /* whether to use WHO command to get dcc_ip */ unsigned int sasl_mech; /* mechanism for sasl auth */ unsigned int sent_saslauth:1; /* have sent AUTHENICATE yet */ diff --git a/src/common/server.c b/src/common/server.c index bf860ac1..75192dfa 100644 --- a/src/common/server.c +++ b/src/common/server.c @@ -1754,7 +1754,6 @@ server_set_encoding (server *serv, char *new_encoding) g_free (serv->encoding); /* can be left as NULL to indicate system encoding */ serv->encoding = NULL; - serv->using_cp1255 = FALSE; } if (new_encoding) @@ -1766,14 +1765,9 @@ server_set_encoding (server *serv, char *new_encoding) if (space) space[0] = 0; - /* server_inline() uses this flag */ - if (g_ascii_strcasecmp (serv->encoding, "CP1255") == 0 || g_ascii_strcasecmp (serv->encoding, "WINDOWS-1255") == 0) + /* Default legacy "IRC" encoding to utf-8. */ + if (g_ascii_strcasecmp (serv->encoding, "IRC") == 0) { - serv->using_cp1255 = TRUE; - } - else if (g_ascii_strcasecmp (serv->encoding, "IRC") == 0) - { - /* Default legacy "IRC" encoding to utf-8. */ g_free (serv->encoding); serv->encoding = g_strdup ("UTF-8"); }