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

Got error to convert a PDF #252

Open
anguslou opened this issue Jan 3, 2025 · 3 comments
Open

Got error to convert a PDF #252

anguslou opened this issue Jan 3, 2025 · 3 comments

Comments

@anguslou
Copy link

anguslou commented Jan 3, 2025

UnicodeEncodeError: 'cp950' codec can't encode character '\uf09f' in position 139457: illegal multibyte sequence

@GKilsgaard
Copy link

I am getting this when trying to convert a Danish docx document:
UnicodeEncodeError: 'charmap' codec can't encode character '\u56de' in position 12977: character maps to

@zacken
Copy link

zacken commented Jan 6, 2025

Any document in any format written in Norwegian will fail with an error like this (Actual character code changes):
File "C:\Users\HenrikFørli\AppData\Roaming\Python\Python312\site-packages\markitdown\__main__.py", line 47, in <module> main() File "C:\Users\HenrikFørli\AppData\Roaming\Python\Python312\site-packages\markitdown\__main__.py", line 43, in main print(result.text_content) File "C:\Python312\Lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UnicodeEncodeError: 'charmap' codec can't encode character '\u2264' in position 55937: character maps to <undefined>

@mpetruc
Copy link

mpetruc commented Jan 6, 2025

Not only Norwegian:

File "C:\Users\user1\.local\bin\markitdown.exe\__main__.py", line 8, in <module>
  File "C:\Users\user1\AppData\Roaming\uv\tools\markitdown\Lib\site-packages\markitdown\__main__.py", line 43, in main
    print(result.text_content)
  File "c:\Users\user1\.conda\envs\openai\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 20743: character maps to <undefined>

or

UnicodeEncodeError: 'charmap' codec can't encode characters in position 7563-7564: character maps to <undefined>

I've tried numerous pdfs. All except one errored out with the same type of character encoding error.

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

4 participants