-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
中文字符相关的编码错误 Error in Chinese character encoding #463
Conversation
修复BUG:Name Object 遇到GBK编码时会抛出PyPDF2.utils.PdfReadError: Illegal character in Name Object异常
修复BUG:遇到中文时latin-1无法编码抛出UnicodeEncodeError: 'latin-1' codec can't encode characters in position 8-9: ordinal not in range(256)异常 Chinese character can not use 'latin-1' encode
Update utils.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ran into this same issue and was about submitting a change request to fix. I think this bug fix should be approved to save other developers headaches in future
I was wondering why all those pull requests ignored for so long... |
Thank you for your contribution! It might take until end of the month to make the next release. Latest 01.05.2022 this will be on PyPI :-) |
- PKG: Make Tests not a subpackage (#728) - BUG: Fix ASCII85Decode.decode assertion (#729) - BUG: Error in Chinese character encoding (#463) - BUG: Code duplication in Scripts/2-up.py - ROBUST: Guard 'obj.writeToStream' with 'if obj is not None' - ROBUST: Ignore a /Prev entry with the value 0 in the trailer - MAINT: Remove Sample_Code (#726) - TST: Close file handle in test_writer (#722) - TST: Fix test_get_images (#730) - DEV: Make tox use pytest and add more Python versions (#721) - DOC: Many (#720, #723-725, #469)
generic.py, line 492 PyPDF2.utils.PdfReadError: Illegal character in Name Object
utils.py: lin 238 UnicodeEncodeError: 'latin-1' codec can't encode characters in position 8-9: ordinal not in range(256)