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

Add encoding parameter to 'parse_from_file' #142

Closed
ivbeg opened this issue Jul 1, 2022 · 1 comment
Closed

Add encoding parameter to 'parse_from_file' #142

ivbeg opened this issue Jul 1, 2022 · 1 comment
Assignees

Comments

@ivbeg
Copy link

ivbeg commented Jul 1, 2022

Describe the bug
Right now if you parse files different than the system default encoding, parse_from_file generates UnicodeDecodeError.

To Reproduce
Steps to reproduce the behavior:

  1. Try this SQL file https://github.com/CollectiveIndustries/Mangos_world_database/blob/93b5bb6984237b4b359cf95610feee2671351a40/mangos/mangos_string.sql
  2. use parse_from_file(your_filepath + 'mangos_string.sql')
  3. See error UnicodeDecodeError 'charmap' codec can't decode byte 0x98 in position 3050: character maps to

Expected behavior
Detect encoding using chardet or, a better way, accept encoding param to this function and pass it as the open(filename, 'r', encoding=encoding)

Desktop (please complete the following information):

  • OS: Windows 10
  • Python version: 3.10
@xnuinside xnuinside self-assigned this Dec 14, 2023
@xnuinside
Copy link
Owner

added in 0.31.2 version #217, not sure why I didn't add it early..

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

2 participants