From d6d25b50c001eb88d3cd2ce5dfd8ceb8c0a5712d Mon Sep 17 00:00:00 2001 From: Jyrki Vesterinen Date: Wed, 28 Dec 2016 19:31:35 +0200 Subject: [PATCH] AppVeyor IRC notification: explicitly set character encoding to UTF-8 Attempted fix for @Aginor's name being shown incorrectly. --- utils/appveyor/irc-notify.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/utils/appveyor/irc-notify.py b/utils/appveyor/irc-notify.py index 8876b102190e..2a1e583f9ffd 100644 --- a/utils/appveyor/irc-notify.py +++ b/utils/appveyor/irc-notify.py @@ -140,7 +140,7 @@ def appveyor_vars(): # establish connection irc_sock = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) irc_sock.connect((socket.gethostbyname('chat.freenode.net'), 6697)) - irc_sock.send('NICK {0}\r\nUSER {0} * 0 :{0}\r\n'.format(irc_username).encode()) + irc_sock.send('NICK {0}\r\nUSER {0} * 0 :{0}\r\n'.format(irc_username).encode('utf_8')) irc_file = irc_sock.makefile() while irc_file: @@ -149,22 +149,22 @@ def appveyor_vars(): response = line.split() if response[0] == 'PING': - irc_file.send('PONG {}\r\n'.format(reponse[1]).encode()) + irc_file.send('PONG {}\r\n'.format(reponse[1]).encode('utf_8')) elif response[1] == '433': - irc_sock.send('NICK {}\r\n'.format(irc_nick).encode()) + irc_sock.send('NICK {}\r\n'.format(irc_nick).encode('utf_8')) elif response[1] == '001': time.sleep(5) # join the channel - irc_sock.send('JOIN #{}\r\n'.format(channel).encode()) + irc_sock.send('JOIN #{}\r\n'.format(channel).encode('utf_8')) # send messages for msg in messages: print('PRIVMSG #{} :{}'.format(channel, msg)) - irc_sock.send('PRIVMSG #{} :{}\r\n'.format(channel, msg).encode()) + irc_sock.send('PRIVMSG #{} :{}\r\n'.format(channel, msg).encode('utf_8')) time.sleep(5) # leave the channel - irc_sock.send('PART #{}\r\n'.format(channel).encode()) + irc_sock.send('PART #{}\r\n'.format(channel).encode('utf_8')) sys.exit() except: e = sys.exc_info()[0]