-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The error which forces non-ASCII, is in:
xtf-converter/xtf-converter.py
Line 70 in 5e55835
| print("<!-- Decoding symbol " + str(c) + ": \"" + symbol + "\" -->") |
This is affecting Python 2 and Python 3.
A reproduction of what happens in ASCII terminals:
$ python2 -c "print(u'\xa0')"
$ PYTHONIOENCODING=ascii python2 -c "print(u'\xa0')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 0: ordinal not in range(128)
$ PYTHONIOENCODING=ascii python3 -c "print(u'\xa0')"
Traceback (most recent call last):
File "<string>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character '\xa0' in position 0: ordinal not in range(128)
A workaround is to remove that line altogether.
However, to fix this problem for everyone, we should add an error handler for this line, which catches the error and simply doesn't print the symbol part (symbol) of the message (if the terminal can't print it).
It's a rare issue (most terminals will support some form of unicode).
(This issue was originally reported by @kaosengr)
Metadata
Metadata
Assignees
Labels
No labels