From 5563795db0b52f2d18f2186a90ffa5b7d0a436d0 Mon Sep 17 00:00:00 2001 From: Ingo Meyer Date: Fri, 15 Dec 2023 14:56:36 +0100 Subject: [PATCH 1/2] Allow any UTF-8 encoded character as input not only ASCII This commit enables to read any UTF-8 encoded input key, like German umlauts or accented letters. This fixes GitHub issue #85. --- simple_term_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple_term_menu.py b/simple_term_menu.py index 23d7544..dc18a27 100755 --- a/simple_term_menu.py +++ b/simple_term_menu.py @@ -1473,7 +1473,7 @@ def _read_next_key(self, ignore_case: bool = True) -> str: self._paint_menu() self._paint_before_next_read = False # blocks until any amount of bytes is available - code = os.read(self._tty_in.fileno(), 80).decode("ascii", errors="ignore") + code = os.read(self._tty_in.fileno(), 80).decode("utf-8", errors="ignore") self._reading_next_key = False if code in self._terminal_code_to_codename: return self._terminal_code_to_codename[code] From 5830a671cf683e4a3703c8a35aeb24c269b8d9fe Mon Sep 17 00:00:00 2001 From: Ingo Meyer Date: Fri, 15 Dec 2023 14:57:19 +0100 Subject: [PATCH 2/2] Increase the version number to v1.6.4 --- simple_term_menu.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple_term_menu.py b/simple_term_menu.py index dc18a27..25a07a3 100755 --- a/simple_term_menu.py +++ b/simple_term_menu.py @@ -43,7 +43,7 @@ __email__ = "i.meyer@fz-juelich.de" __copyright__ = "Copyright © 2021 Forschungszentrum Jülich GmbH. All rights reserved." __license__ = "MIT" -__version_info__ = (1, 6, 3) +__version_info__ = (1, 6, 4) __version__ = ".".join(map(str, __version_info__))