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

Encoding error with non-UTF-8 PDFs #49

Open
PierreMesure opened this issue Dec 8, 2024 · 0 comments
Open

Encoding error with non-UTF-8 PDFs #49

PierreMesure opened this issue Dec 8, 2024 · 0 comments

Comments

@PierreMesure
Copy link

Hi,

I'm getting errors with PDFs encoded with latin-1. Here's an example.

The problem occurs at this line because the byte string isn't encoded with UTF-8. If I replace with title.decode('iso-8859-1'), it works flawlessly.

I think a solution would be to extract the info encoding using pdfminer but I couldn't find how. Another possibility is using chardet or testing for several encodings and catching the exceptions.

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