Only perform unicode escape in regex mode.

This commit is contained in:
voussoir 2023-06-24 12:02:31 -07:00
parent b06ebab241
commit a5a86313fa

View file

@ -51,10 +51,11 @@ def contentreplace_argparse(args):
if not replace_to: if not replace_to:
replace_to = pyperclip.paste() replace_to = pyperclip.paste()
else: else:
replace_from = codecs.decode(args.replace_from, 'unicode_escape')
if args.do_regex: if args.do_regex:
replace_from = args.replace_from
replace_to = args.replace_to replace_to = args.replace_to
else: else:
replace_from = codecs.decode(args.replace_from, 'unicode_escape')
replace_to = codecs.decode(args.replace_to, 'unicode_escape') replace_to = codecs.decode(args.replace_to, 'unicode_escape')
for file in files: for file in files: