You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method doesn't work because the bytes of Big5-UAO encoded string may contain control characters like \x9d, and match_text failed to match the entire string:
I want to feed some Big5-UAO encoded data. Since there is no
encoding
parameter (or something like that), I tried usingByteStream
:However, after checking the source code, it seems that this setup equals to:
This method doesn't work because the bytes of Big5-UAO encoded string may contain control characters like
\x9d
, andmatch_text
failed to match the entire string:pyte/pyte/streams.py
Lines 132 to 135 in 676610b
Here I generated a list of unicode character which contains control characters if encoded in Big5-UAO:
https://gist.github.com/eight04/3de731b7300a6b5036e082f801e2e3e9
How about encoding the bytes into unicode string with Big5-UAO before passing it to
stream.feed
?We can't. In our usecase, we need a special feature called "雙色字". It colors a double width charater with two different colors. For example:
"我"
into bytesb'\xa7\xda'
b'\x1b[1;31m\xa7\x1b[32m\xda'
As a result, we can't decode the bytes before the escape code is parsed.
May we can add a flag to disable C1 controls in
Stream.feed
parser?The text was updated successfully, but these errors were encountered: