From 362d60ab8f3ff12427325dc7bdaa2bb59b908079 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Sat, 26 Nov 2005 13:06:02 +0000
Subject: [PATCH] print strange chars correctly

---
 scripts/migrate_logs_to_dot9_db.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/scripts/migrate_logs_to_dot9_db.py b/scripts/migrate_logs_to_dot9_db.py
index 0a15ae9908..00d1cedff6 100755
--- a/scripts/migrate_logs_to_dot9_db.py
+++ b/scripts/migrate_logs_to_dot9_db.py
@@ -154,10 +154,10 @@ def visit(arg, dirname, filenames):
 
 		if filename == os.path.basename(dirname): # gajim@conf/gajim@conf then gajim@conf is type room
 			jid_type = constants.JID_ROOM_TYPE
-			print 'Processing', jid, 'of type room'
+			print 'Processing', jid.encode('utf-8'), 'of type room'
 		else:
 			jid_type = constants.JID_NORMAL_TYPE
-			print 'Processing', jid, 'of type normal'
+			print 'Processing', jid.encode('utf-8'), 'of type normal'
 
 		JID_ID = None
 		f = open(path_to_text_file, 'r')
@@ -176,7 +176,7 @@ def visit(arg, dirname, filenames):
 				# here I convert
 				# gc ==> gc_msg, gcstatus ==> gcstatus, recv ==> chat_msg_recv
 				# sent ==> chat_msg_sent, status ==> status
-				type = splitted_line[1] # line[1] has type of logged message
+				typ = splitted_line[1] # line[1] has type of logged message
 				message_data = splitted_line[2:] # line[2:] has message data
 				# line[0] is date,
 				# some lines can be fucked up, just drop them
@@ -187,19 +187,19 @@ def visit(arg, dirname, filenames):
 
 				contact_name = None
 				show = None
-				if type == 'gc':
+				if typ == 'gc':
 					contact_name = message_data[0]
 					message = ':'.join(message_data[1:])
 					kind = constants.KIND_GC_MSG
-				elif type == 'gcstatus':
+				elif typ == 'gcstatus':
 					contact_name = message_data[0]
 					show = message_data[1]
 					message = ':'.join(message_data[2:]) # status msg
 					kind = constants.KIND_GCSTATUS
-				elif type == 'recv':
+				elif typ == 'recv':
 					message = ':'.join(message_data[0:])
 					kind = constants.KIND_CHAT_MSG_RECV
-				elif type == 'sent':
+				elif typ == 'sent':
 					message = ':'.join(message_data[0:])
 					kind = constants.KIND_CHAT_MSG_SENT
 				else: # status
-- 
GitLab