From 6a8c54bb5294b6cb8d55d1986affdd50a2f40963 Mon Sep 17 00:00:00 2001 From: Silas Kraume Date: Thu, 7 Sep 2023 12:17:46 +0200 Subject: [PATCH] unicode seq in echo --- cat_win/cat.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cat_win/cat.py b/cat_win/cat.py index bb2352d3..c678c73b 100644 --- a/cat_win/cat.py +++ b/cat_win/cat.py @@ -920,6 +920,14 @@ def init(shell: bool = False) -> tuple: config.save_config() sys.exit(0) + if holder.args_id[ARGS_ECHO]: + echo_args = ' '.join(echo_args) + for arg, param in holder.args: + if arg == ARGS_ECHO: + if param == param.upper(): + echo_args = echo_args.encode(arg_parser.file_encoding).decode('unicode_escape') + break + return (known_files, unknown_files, echo_args, valid_urls) @@ -928,7 +936,7 @@ def main(): known_files, unknown_files, echo_args, valid_urls = init(shell=False) if holder.args_id[ARGS_ECHO]: - temp_file = stdinhelper.write_file(' '.join(echo_args), tmp_file_helper.generate_temp_file_name(), arg_parser.file_encoding) + temp_file = stdinhelper.write_file(echo_args, tmp_file_helper.generate_temp_file_name(), arg_parser.file_encoding) known_files.append(temp_file) holder.set_temp_file_echo(temp_file) if holder.args_id[ARGS_URI]: