Skip to content

Commit

Permalink
fall back to no encoding if error on -E
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenZcience committed Mar 11, 2024
1 parent bc76378 commit 67c7f26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cat_win/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,10 @@ def init(shell: bool = False) -> tuple:
for arg, param in holder.args:
if arg == ARGS_ECHO:
if param.isupper():
echo_args = echo_args.encode(arg_parser.file_encoding).decode('unicode_escape').encode('latin-1').decode(arg_parser.file_encoding)
try:
echo_args = echo_args.encode(arg_parser.file_encoding).decode('unicode_escape').encode('latin-1').decode(arg_parser.file_encoding)
except UnicodeError:
pass
break

Editor.set_indentation(const_dic[DKW.EDITOR_INDENTATION], const_dic[DKW.EDITOR_AUTO_INDENT])
Expand Down

0 comments on commit 67c7f26

Please sign in to comment.