changeset 14285:baf9f997746c

[gaim-migrate @ 16971] Add an encoding option. Let's you specify something other than iso-8859-1 for the nonUTF-8 pieces of the protocol. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Tue, 22 Aug 2006 05:30:30 +0000
parents d559d6dcb970
children a0394e417fab
files libgaim/protocols/yahoo/util.c libgaim/protocols/yahoo/yahoo.c
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/yahoo/util.c	Tue Aug 22 04:46:42 2006 +0000
+++ b/libgaim/protocols/yahoo/util.c	Tue Aug 22 05:30:30 2006 +0000
@@ -59,7 +59,7 @@
 	if (yd->jp)
 		to_codeset = "SHIFT_JIS";
 	else
-		to_codeset = "ISO-8859-1";
+		to_codeset = gaim_account_get_string(gaim_connection_get_account(gc), "local_charset",  "ISO-8859-1");
 
 	ret = g_convert_with_fallback(str, strlen(str), to_codeset, "UTF-8", "?", NULL, NULL, NULL);
 	if (ret)
@@ -80,7 +80,7 @@
 {
 	struct yahoo_data *yd = gc->proto_data;
 	char *ret;
-	char *from_codeset;
+	const char *from_codeset;
 
 	if (utf8) {
 		if (g_utf8_validate(str, -1, NULL))
@@ -90,7 +90,7 @@
 	if (yd->jp)
 		from_codeset = "SHIFT_JIS";
 	else
-		from_codeset = "ISO-8859-1";
+		from_codeset = gaim_account_get_string(gaim_connection_get_account(gc), "local_charset",  "ISO-8859-1");
 
 	ret = g_convert_with_fallback(str, strlen(str), "UTF-8", from_codeset, NULL, NULL, NULL, NULL);
 
--- a/libgaim/protocols/yahoo/yahoo.c	Tue Aug 22 04:46:42 2006 +0000
+++ b/libgaim/protocols/yahoo/yahoo.c	Tue Aug 22 05:30:30 2006 +0000
@@ -3884,6 +3884,10 @@
 	option = gaim_account_option_bool_new(_("Ignore conference and chatroom invitations"), "ignore_invites", FALSE);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
+	option = gaim_account_option_string_new(_("Encoding"), "local_charset", "ISO-8859-1");
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+
+
 #if 0
 	option = gaim_account_option_string_new(_("Chat room list URL"), "room_list", YAHOO_ROOMLIST_URL);
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);