rabbitgrowth / plover-tapey-tape

Plover paper tape plugin with hesitation bars and stroke suggestions
GNU General Public License v3.0
14 stars 4 forks source link

Unwanted errors with unicode text #2

Closed derekthecool closed 2 years ago

derekthecool commented 2 years ago

Hi, amazing project! I've been using this quite a bit and think it is wonderful!

Short problem description

I'm getting lots of repeat error messages from using unicode text. I'm using emily-symbols and I often use the cool symbols.

Reproducing the behavior

The ones I am using most often are these awesome arrows ← → ↑ ↓
Which gives errors in the Plover log file like this

2022-05-26 13:37:40,957 [Dummy-1] ERROR: hook 'stroked' callback <bound method TapeyTape.on_stroked of <plover_tapey_tape.TapeyTape object at 0x0000022093265D60>> failed
Traceback (most recent call last):
  File "build/windist/data\Lib\site-packages\plover\engine.py", line 564, in _trigger_hook
  File "C:\Users\Derek Lomax\AppData\Local\plover\plover\plugins\win\Python38\site-packages\plover_tapey_tape.py", line 288, in on_stroked
    self.file.write(self.expand(self.left_format, self.items))
  File "encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\u2193' in position 36: character maps to <undefined>

And then those the system pop up warning message.

Actions

I can help to solve the issue, but I have not started looking for anything yet.

Thanks again for the cool project!

rabbitgrowth commented 2 years ago

Hi, thanks for reporting the problem! I believe it’s caused by Windows not defaulting to Unicode. I’ve made it so that the output file is always opened in UTF-8; this should fix it. Please update the plugin to the latest version by going to the Plugins Manager, selecting plover-tapey-tape, then clicking “Install/Update”. Cheers!

derekthecool commented 2 years ago

Wow, that was a quick fix! Everything is working without the errors now!

Now I can keep my Zen better without seeing those errors!

𝕿𝖍𝖆𝖓𝖐 𝖞𝖔𝖚 𝖘𝖔 𝖒𝖚𝖈𝖍! 𝕿𝖍𝖎𝖘 𝖎𝖘 𝖜𝖔𝖓𝖉𝖊𝖗𝖋𝖚𝖑!