mht files (and xls files containing mht content) may not be decoded using the correct charset. htmlxls2xlsx.py uses the UnicodeDammit package from bs4 to decode the contents, which guesses what encoding to use. Sometimes it guesses wrong. However, these files typically contain a line like:
Content-Type: text/html; charset="windows-1252"
which specifies the proper encoding. The call to UnicodeDammit should be changed to pass in the encoding if the file contains such a line.
mht files (and xls files containing mht content) may not be decoded using the correct charset.
htmlxls2xlsx.pyuses theUnicodeDammitpackage from bs4 to decode the contents, which guesses what encoding to use. Sometimes it guesses wrong. However, these files typically contain a line like:which specifies the proper encoding. The call to
UnicodeDammitshould be changed to pass in the encoding if the file contains such a line.