From a5a86313fa471486dd227306644f8a95a2177d91 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 24 Jun 2023 12:02:31 -0700 Subject: [PATCH] Only perform unicode escape in regex mode. --- contentreplace.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contentreplace.py b/contentreplace.py index 3bb6aaa..b7e31c6 100644 --- a/contentreplace.py +++ b/contentreplace.py @@ -51,10 +51,11 @@ def contentreplace_argparse(args): if not replace_to: replace_to = pyperclip.paste() else: - replace_from = codecs.decode(args.replace_from, 'unicode_escape') if args.do_regex: + replace_from = args.replace_from replace_to = args.replace_to else: + replace_from = codecs.decode(args.replace_from, 'unicode_escape') replace_to = codecs.decode(args.replace_to, 'unicode_escape') for file in files: