kattrali / weemoji

Weechat plugin to replace emoji in the 'colon' format with unicode equivalents! :thumbsup:
Other
29 stars 1 forks source link

Interpret message as UTF-8 #9

Closed sotpapathe closed 3 years ago

sotpapathe commented 3 years ago

Otherwise it is interpreted as ASCII it seems and certain messages produce the following error:

python: stdout/stderr (weemoji):     return MATCHER.sub(replace_emoji, message)
python: stdout/stderr (weemoji): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 28: ordinal not in range(128)
python: error in function "interpolate_emoji_cb"
sotpapathe commented 3 years ago

Turns out this is needed only for Python 2 and doesn't work in Python 3. Considering Python 2 is deprecated, the fix is probably not needed.