ReceiptManager / receipt-parser-legacy

A supermarket receipt parser written in Python using tesseract OCR

Home Page:https://tech.trivago.com/2015/10/06/python_receipt_parser/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnicodeEncodeError while reading image data

janmoppel opened this issue · comments

Env:

Windows 10, Python 3.9.

Issue:

Got the UnicodeEncodeError while processing example tesseract image data with make run.
UnicodeEncodeError: 'charmap' codec can't encode character '\xfc' in position 57: character maps to <undefined>

Solution:

Specify utf-8 encoding while reading the data.
out = open(output_file, "w", encoding='utf-8')

Thanks for catching. See: 4a0d275

Does it work now?

Regards,

William

Yes, it's good now. Thank you.