From 4bc459e18f5888016bd50faa653a07f7dbb8d810 Mon Sep 17 00:00:00 2001 From: David Flatz Date: Mon, 16 Oct 2023 14:16:02 +0200 Subject: [PATCH] fish 0.15: fix encoding errors with message markers --- python/fish.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/fish.py b/python/fish.py index bf42a6aa..17506076 100644 --- a/python/fish.py +++ b/python/fish.py @@ -61,7 +61,7 @@ SCRIPT_NAME = "fish" SCRIPT_AUTHOR = "David Flatz " -SCRIPT_VERSION = "0.14" +SCRIPT_VERSION = "0.15" SCRIPT_LICENSE = "GPL3" SCRIPT_DESC = "FiSH for weechat" CONFIG_FILE_NAME = SCRIPT_NAME @@ -894,7 +894,7 @@ def fish_modifier_input_text(data, modifier, server_name, string): targetl = target.lower() if targetl not in fish_keys: return string - return "%s" % (fish_msg_w_marker(string)) + return "%s" % (fish_msg_w_marker(string.encode()).decode()) def fish_unload_cb(): @@ -1139,11 +1139,11 @@ def fish_list_keys(buffer): def fish_msg_w_marker(msg): - marker = weechat.config_string(fish_config_option["mark_encrypted"]) + marker = weechat.config_string(fish_config_option["mark_encrypted"]).encode() if weechat.config_string(fish_config_option["mark_position"]) == "end": - return "%s%s" % (msg, marker) + return b"%s%s" % (msg, marker) elif weechat.config_string(fish_config_option["mark_position"]) == "begin": - return "%s%s" % (marker, msg) + return b"%s%s" % (marker, msg) else: return msg