Skip to content

Commit

Permalink
fish 0.15: fix encoding errors with message markers
Browse files Browse the repository at this point in the history
  • Loading branch information
freshprince committed Oct 16, 2023
1 parent 3bd5eda commit 4bc459e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/fish.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

SCRIPT_NAME = "fish"
SCRIPT_AUTHOR = "David Flatz <david@upcs.at>"
SCRIPT_VERSION = "0.14"
SCRIPT_VERSION = "0.15"
SCRIPT_LICENSE = "GPL3"
SCRIPT_DESC = "FiSH for weechat"
CONFIG_FILE_NAME = SCRIPT_NAME
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4bc459e

Please sign in to comment.