Only in bitlbee-1.2: bitlbee.pc
Only in bitlbee-1.2: config.h
diff -aur tmp/bitlbee-1.2/irc.c bitlbee-1.2/irc.c
--- tmp/bitlbee-1.2/irc.c	2008-02-08 00:25:16.000000000 +0300
+++ bitlbee-1.2/irc.c	2008-04-06 15:32:44.000000000 +0400
@@ -1,4 +1,4 @@
-  /********************************************************************\
+/********************************************************************   \
   * BitlBee -- An IRC to other IM-networks gateway                     *
   *                                                                    *
   * Copyright 2002-2004 Wilmer van der Gaast and others                *
@@ -109,6 +109,7 @@
 	set_add( &irc->set, "buddy_sendbuffer", "false", set_eval_bool, irc );
 	set_add( &irc->set, "buddy_sendbuffer_delay", "200", set_eval_int, irc );
 	set_add( &irc->set, "charset", "utf-8", set_eval_charset, irc );
+    set_add( &irc->set, "oscar_recode_charset", "utf-8", set_eval_oscar_recode_charset, irc );
 	set_add( &irc->set, "debug", "false", set_eval_bool, irc );
 	set_add( &irc->set, "default_target", "root", NULL, irc );
 	set_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc );
Only in bitlbee-1.2: Makefile.settings
Only in bitlbee-1.2/protocols/oscar: #*merge<2>*#4941WKm#
Only in bitlbee-1.2/protocols/oscar: #*merge*#4941JAg#
diff -aur tmp/bitlbee-1.2/protocols/oscar/oscar.c bitlbee-1.2/protocols/oscar/oscar.c
--- tmp/bitlbee-1.2/protocols/oscar/oscar.c	2008-01-31 02:03:16.000000000 +0300
+++ bitlbee-1.2/protocols/oscar/oscar.c	2008-04-08 03:33:57.000000000 +0400
@@ -1026,6 +1026,14 @@
 	return 1;
 }
 
+static char *get_oscar_recode_charset(struct im_connection *ic ) {
+    char *cs;
+    char *src = "ISO8859-1";
+    if ((cs = set_getstr(&ic->irc->set, "oscar_recode_charset")) && (g_strcasecmp(cs, "utf-8") != 0))
+        src = cs;
+    return src;
+}
+
 static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) {
 	char *tmp = g_malloc(BUF_LONG + 1);
 	struct im_connection *ic = sess->aux_data;
@@ -1040,8 +1048,8 @@
 		if (args->icbmflags & AIM_IMFLAGS_UNICODE)
 			src = "UNICODEBIG";
 		else
-			src = "ISO8859-1";
-		
+            src = get_oscar_recode_charset(ic);
+
 		/* Try to use iconv first to convert the message to UTF8 - which is what BitlBee expects */
 		if (do_iconv(src, "UTF-8", args->msg, tmp, args->msglen, BUF_LONG) >= 0) {
 			// Successfully converted!
@@ -2237,6 +2245,7 @@
 {
 	struct im_connection *ic = sess->aux_data;
 	struct oscar_data *od = ic->proto_data;
+    char tmp[BUF_LONG];
 	gchar who[16];
 	GString *str;
 	va_list ap;
@@ -2253,10 +2262,12 @@
 	str = g_string_sized_new(512);
 	g_snprintf(who, sizeof(who), "%u", info->uin);
 
+#define translate(x) ((do_iconv(get_oscar_recode_charset(ic), "UTF-8", x, tmp, strlen(x), BUF_LONG) >= 0) ? tmp : x)
+
 	g_string_printf(str, "%s: %s - %s: %s", _("UIN"), who, _("Nick"), 
-	info->nick ? info->nick : "-");
-	g_string_append_printf(str, "\n%s: %s", _("First Name"), info->first);
-	g_string_append_printf(str, "\n%s: %s", _("Last Name"), info->last);
+                    info->nick ? translate(info->nick) : "-");
+	g_string_append_printf(str, "\n%s: %s", _("First Name"), translate(info->first));
+	g_string_append_printf(str, "\n%s: %s", _("Last Name"), translate(info->last));
 	g_string_append_printf(str, "\n%s: %s", _("Email Address"), info->email);
 	if (info->numaddresses && info->email2) {
 		int i;
@@ -2289,36 +2300,38 @@
 	g_string_append_printf(str, "\n%s: %s", _("Personal Web Page"), info->personalwebpage);
 	if (info->info && info->info[0]) {
 		g_string_sprintfa(str, "\n%s:\n%s\n%s", _("Additional Information"), 
-		info->info, _("End of Additional Information"));
+                          translate(info->info), _("End of Additional Information"));
 	}
 	g_string_append_c(str, '\n');
 	if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) {
 		g_string_append_printf(str, "%s:", _("Home Address"));
-		g_string_append_printf(str, "\n%s: %s", _("Address"), info->homeaddr);
-		g_string_append_printf(str, "\n%s: %s", _("City"), info->homecity);
-		g_string_append_printf(str, "\n%s: %s", _("State"), info->homestate); 
+		g_string_append_printf(str, "\n%s: %s", _("Address"), translate(info->homeaddr));
+		g_string_append_printf(str, "\n%s: %s", _("City"), translate(info->homecity));
+		g_string_append_printf(str, "\n%s: %s", _("State"), translate(info->homestate)); 
 		g_string_append_printf(str, "\n%s: %s", _("Zip Code"), info->homezip);
 		g_string_append_c(str, '\n');
 	}
 	if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) {
 		g_string_append_printf(str, "%s:", _("Work Address"));
-		g_string_append_printf(str, "\n%s: %s", _("Address"), info->workaddr);
-		g_string_append_printf(str, "\n%s: %s", _("City"), info->workcity);
-		g_string_append_printf(str, "\n%s: %s", _("State"), info->workstate);
+		g_string_append_printf(str, "\n%s: %s", _("Address"), translate(info->workaddr));
+		g_string_append_printf(str, "\n%s: %s", _("City"), translate(info->workcity));
+		g_string_append_printf(str, "\n%s: %s", _("State"), translate(info->workstate));
 		g_string_append_printf(str, "\n%s: %s", _("Zip Code"), info->workzip);
 		g_string_append_c(str, '\n');
 	}
 	if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) {
 		g_string_append_printf(str, "%s:", _("Work Information"));
-		g_string_append_printf(str, "\n%s: %s", _("Company"), info->workcompany);
-		g_string_append_printf(str, "\n%s: %s", _("Division"), info->workdivision);
-		g_string_append_printf(str, "\n%s: %s", _("Position"), info->workposition);
+		g_string_append_printf(str, "\n%s: %s", _("Company"), translate(info->workcompany));
+		g_string_append_printf(str, "\n%s: %s", _("Division"), translate(info->workdivision));
+		g_string_append_printf(str, "\n%s: %s", _("Position"), translate(info->workposition));
 		if (info->workwebpage && info->workwebpage[0]) {
 			g_string_append_printf(str, "\n%s: %s", _("Web Page"), info->workwebpage);
 		}
 		g_string_append_c(str, '\n');
 	}
 
+#undef translate
+
 	imcb_log(ic, "%s\n%s", _("User Info"), str->str);
 	g_string_free(str, TRUE);
 
diff -aur tmp/bitlbee-1.2/set.c bitlbee-1.2/set.c
--- tmp/bitlbee-1.2/set.c	2007-11-17 13:52:54.000000000 +0300
+++ bitlbee-1.2/set.c	2008-04-08 01:35:25.000000000 +0400
@@ -244,3 +244,18 @@
 	g_iconv_close( cd );
 	return value;
 }
+
+char *set_eval_oscar_recode_charset( set_t *set, char *value )
+{
+	GIConv cd;
+
+	if ( g_strncasecmp( value, "none", 4 ) == 0 )
+		return value;
+
+	cd = g_iconv_open( "UTF-8", value );
+	if( cd == (GIConv) -1 )
+		return NULL;
+
+	g_iconv_close( cd );
+	return value;
+}
diff -aur tmp/bitlbee-1.2/set.h bitlbee-1.2/set.h
--- tmp/bitlbee-1.2/set.h	2007-11-16 01:44:12.000000000 +0300
+++ bitlbee-1.2/set.h	2008-04-08 01:32:44.000000000 +0400
@@ -97,5 +97,6 @@
 char *set_eval_to_char( set_t *set, char *value );
 char *set_eval_ops( set_t *set, char *value );
 char *set_eval_charset( set_t *set, char *value );
+char *set_eval_oscar_recode_charset( set_t *set, char *value );
 
 #endif /* __SET_H__ */
Only in bitlbee-1.2: tags
Only in bitlbee-1.2: TAGS
