UnicodeEncodeError: 'gbk' codec can't encode character '\u2022' in position 10470: illegal multibyte sequence
(Microsoft-MarkItDown) C:\Users\zaish01317\MarkItDown>markitdown "C:\Users\zaish01317\translation-agent\examples\sample-texts\Modular RAG Transforming RAG Systems into LEGO-like Reconfigurable Frameworks.pdf"
"C:\Users\zaish01317\translation-agent\examples\sample-texts\Modular RAG Transforming RAG Systems into LEGO-like Reconfigurable Frameworks.pdf.md" Traceback (most recent call last): File "C:\Users\zaish01317.conda\envs\Microsoft-MarkItDown\lib\runpy.py", line 196, in _run_module_as_main return run_code(code, main_globals, None, File "C:\Users\zaish01317.conda\envs\Microsoft-MarkItDown\lib\runpy.py", line 86, in run_code exec(code, run_globals) File "C:\Users\zaish01317.conda\envs\Microsoft-MarkItDown\Scripts\markitdown.exe_main.py", line 7, in
File "C:\Users\zaish01317.conda\envs\Microsoft-MarkItDown\lib\site-packages\markitdown_main .py", line 43, in main print(result.text_content) UnicodeEncodeError: 'gbk' codec can't encode character '\u2022' in position 10470: illegal multibyte sequence
(Microsoft-MarkItDown) C:\Users\zaish01317\MarkItDown>markitdown ModularRAG.pdf > ModularRAG.pdf.md
Traceback (most recent call last):
File "C:\Users\zaish01317.conda\envs\Microsoft-MarkItDown\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\zaish01317.conda\envs\Microsoft-MarkItDown\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\zaish01317.conda\envs\Microsoft-MarkItDown\Scripts\markitdown.exe_main.py", line 7, in
markitdown = MarkItDown()
result = markitdown.convert(read_filename)
with open('write_filename.md', 'w', encoding='gbk', errors='ignore') as f:
f.write(result.text_content)
Thank you @HArars
This works too:
>chcp 65001
Active code page: 65001
>set PYTHONIOENCODING=utf-8
>markitdown my_document.pdf > my_document.md
This works too:
chcp 65001 Active code page: 65001
set PYTHONIOENCODING=utf-8
markitdown my_document.pdf > my_document.md
it seems does not work properly
The reported stdout encoding crash is addressed on main. For saved Markdown, please use markitdown input.pdf -o output.md (with your actual input filename). The -o option introduced in #116 writes UTF-8 directly and preserves characters that the terminal cannot represent; terminal output may replace unsupported characters.
Closing this encoding report as resolved. Please ask to reopen if the crash persists with the updated code, including your version and complete traceback.