-1

This addon would normally export Anki Notes in a PDF. How can I repare it?

Debuginformationen:
Anki 2.1.53 (96bacf79) Python 3.9.7 Qt 5.15.2 PyQt 5.15.5
Platform: Windows 10
Flags: frz=True ao=True sv=2
Add-ons, last update check: 2022-07-11 08:21:44

Caught exception:
Traceback (most recent call last):
  File "C:\Users\lombe\AppData\Roaming\Anki2\addons21\anki-export\__init__.py", line 37, in <lambda>
    a.triggered.connect(lambda: export_cards(browser.selectedCards()))
  File "C:\Users\lombe\AppData\Roaming\Anki2\addons21\anki-export\__init__.py", line 30, in export_cards
    file.write(output_text)
  File "tempfile", line 474, in func_wrapper
  File "encodings.cp1252", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\u03c6' in position 45247: character maps to <undefined>
Mou
  • 1
  • 1

1 Answers1

1

Make sure you specify UTF-8 encoding in open(). E.g:

open('myfile', encoding='utf-8')
Abdo
  • 11
  • 2
  • This is probably completely wrong if you want to write binary output, but the question contains far too little information to properly troubleshoot the problem. – tripleee Aug 14 '22 at 07:24