fixed py read utf
This commit is contained in:
@@ -96,8 +96,8 @@ class Clyx:
|
|||||||
else:
|
else:
|
||||||
r = fd.readline() if (fd is sys.stdin or fd.__class__.__name__ in ('FD0', 'Sock')) else fd.read()
|
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')
|
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]
|
data = r.encode('utf-8') if isinstance(r, str) else r
|
||||||
self._stack.append(res)
|
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 _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):
|
def _exec_loop(self, c, b):
|
||||||
while (self._exec_qform(c), self._stack.pop())[1]: self._exec_qform(b)
|
while (self._exec_qform(c), self._stack.pop())[1]: self._exec_qform(b)
|
||||||
|
|||||||
Reference in New Issue
Block a user