From 3b67415d0e3cd076dac0df8cec43cfcc8019e5c0 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Tue, 7 Jul 2026 08:34:55 +0300 Subject: [PATCH] fixed py read utf --- clyx-python/clyx/clyx.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clyx-python/clyx/clyx.py b/clyx-python/clyx/clyx.py index ea6168d..066131b 100755 --- a/clyx-python/clyx/clyx.py +++ b/clyx-python/clyx/clyx.py @@ -96,8 +96,8 @@ class Clyx: else: r = fd.readline() if (fd is sys.stdin or fd.__class__.__name__ in ('FD0', 'Sock')) else fd.read() r = r.rstrip(b'\r\n' if isinstance(r, bytes) else '\r\n') - res = list(r) if isinstance(r, (bytes, bytearray)) else [ord(c) for c in r] - self._stack.append(res) + data = r.encode('utf-8') if isinstance(r, str) else r + self._stack.append(list(data)) def _cmd_qset(self): i, v, x = self._stack.pop(), self._stack.pop(), self._stack.pop(); (v.pop(int(i)), v.insert(int(i), x)) if isinstance(v, list) else None; self._stack.append(v if isinstance(v, list) else None) def _exec_loop(self, c, b): while (self._exec_qform(c), self._stack.pop())[1]: self._exec_qform(b)