diff --git a/utils/story_functions.py b/utils/story_functions.py index 1e92fa89e..370a7f2b4 100644 --- a/utils/story_functions.py +++ b/utils/story_functions.py @@ -277,7 +277,7 @@ def truncate_chars(value, max_length): return value.decode('utf-8', 'ignore') truncd_val = value[:max_length] - if value[max_length].decode() != " ": + if value[max_length] != b" ": rightmost_space = truncd_val.rfind(b" ") if rightmost_space != -1: truncd_val = truncd_val[:rightmost_space]