The default encoding is platform dependent (whatever locale.getpreferredencoding() returns)
When report tool is started on OS with environment encoding different from UTF-8 (CP-1252 for example), following error is occured
File "C:\Users\kubikrubikvkube\dev\htcap_forked\htcap\htcap.py", line 83, in <module>
Util(argv[1:], dbfile)
File "C:\Users\kubikrubikvkube\dev\htcap_forked\htcap\core\util\util.py", line 43, in __init__
run(args, util)
File "C:\Users\kubikrubikvkube\dev\htcap_forked\htcap\core\util\base_util.py", line 61, in __init__
self.main(args, opts, db_file)
File "C:\Users\kubikrubikvkube\dev\htcap_forked\htcap\core\util\utilities\report.py", line 229, in main
html = base_html % (css.read(), jsn, js.read(), html.read())
File "C:\Users\kubikrubikvkube\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 5744: character maps to <undefined>
Process finished with exit code 1
I propose to not use platform dependent encoding, but always generate report in UTF-8 encoding.
As mentioned in Python <=3.8 documentation
When report tool is started on OS with environment encoding different from UTF-8 (CP-1252 for example), following error is occured
I propose to not use platform dependent encoding, but always generate report in UTF-8 encoding.