From dfd7b09d9e009cd3d15058f6723f96cd7552efe9 Mon Sep 17 00:00:00 2001 From: James Booth Date: Wed, 20 Jul 2016 00:56:45 +0100 Subject: [PATCH] Make emoticons.py python2 and 3 compatible --- emoticons.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emoticons.py b/emoticons.py index 4035a1c..5922029 100644 --- a/emoticons.py +++ b/emoticons.py @@ -3,14 +3,15 @@ Convert smileys ( :) :( etc) to the Unicode character representation """ import prof +from builtins import chr def _emote(input_str): result = input_str - result = result.replace(":-)", u'\u263a'.encode("utf-8")) - result = result.replace(":)", u'\u263a'.encode("utf-8")) - result = result.replace(":-(", u'\u2639'.encode("utf-8")) - result = result.replace(":(", u'\u2639'.encode("utf-8")) + result = result.replace(":-)", chr(9786)) + result = result.replace(":)", chr(9786)) + result = result.replace(":-(", chr(9785)) + result = result.replace(":(", chr(9785)) return result