Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add encoding parameter to 'parse_from_file' #142

Copy link
Copy link
@ivbeg

Description

@ivbeg
Issue body actions

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.