Remarkable icon indicating copy to clipboard operation
Remarkable copied to clipboard

Error in decoding UTF-8 characters

Open ghost opened this issue 7 years ago • 2 comments

Trying to open a file that contains some UTF-8 characters, the GUI freezes, and the console reports that error : Traceback (most recent call last): File "/usr/lib/python3/dist-packages/remarkable/RemarkableWindow.py", line 356, in on_menuitem_open_activate self.open(self) File "/usr/lib/python3/dist-packages/remarkable/RemarkableWindow.py", line 382, in open text = file.read() File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 366: ordinal not in range(128)

OS : Ubuntu 16.04.3 LTS Version : 1.87 Language env. variables LANG=en_US.UTF-8 GDM_LANG=en_US LANGUAGE=en_US:en

ghost avatar Jan 30 '18 14:01 ghost

I met the same problem!

Kyle0122 avatar Jun 19 '18 06:06 Kyle0122

@Kyle0122 @ymarcov

Here's a patch that'll get UTF-8 working. Not heavily tested but load and save seem to work correctly.

Uncompress the attached file (perhaps with gunzip RemarkableWindow.py.patch.gz) and save it to /tmp/RemarkableWindow.py.patch

To test this patch, go to the directory containing RemarkableWindow.py (possibly /usr/lib/python3/dist-packages/remarkable/) and run:
sudo patch --dry-run -p1 -i /tmp/RemarkableWindow.py.patch

If no errors appear, apply the patch by running:
sudo patch -p1 -i /tmp/RemarkableWindow.py.patch

This patch was generated with:
diff -c RemarkableWindow.py patched/RemarkableWindow.py

Alex-Kent avatar Apr 01 '19 21:04 Alex-Kent