Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mht files (and xls files containing mht content) may not be decoded using the correct charset #23

Open
snoopyjc opened this issue Sep 2, 2023 · 0 comments
Assignees

Comments

@snoopyjc
Copy link
Owner

snoopyjc commented Sep 2, 2023

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.

@snoopyjc snoopyjc self-assigned this Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant