From 0e10b7cfad3de24fcd21e8b806cbb4b60470724b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Fri, 30 Dec 2022 17:39:20 +0100 Subject: [PATCH] Prompt user for string if can_encode.py is invoked without an argument This allows usage on Windows, which by default does not support unicode fully in the command line. --- can_encode.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/can_encode.py b/can_encode.py index ee1d648..d7b0788 100644 --- a/can_encode.py +++ b/can_encode.py @@ -2,7 +2,10 @@ import sys import char_encodings -decoded = sys.argv[1] +if len(sys.argv) == 2: + decoded = sys.argv[1] +else: + decoded = input() singlebyte = {} multibyte = {}