On Thu, 2013-03-07 at 16:24 +0100, Vratislav Podzimek wrote:
libxklavier now returns lists of ordinal numbers of chars instead of
null-byte terminated strings.
Signed-off-by: Vratislav Podzimek <vpodzime(a)redhat.com>
---
pyanaconda/keyboard.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index fc4914a..6407b98 100755
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -292,8 +292,9 @@ def activate_keyboard(keyboard):
def item_str(s):
"""Convert a zero-terminated byte array to a proper
str"""
- i = s.find(b'\x00')
- return s[:i].decode("utf-8") #there are some non-ascii layout
descriptions
+ i = s.index(0)
+ s = "".join(chr(char) for char in s[:i])
There needs to be 'if
char <= 255' added here^
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic