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

Extend codec support for CSA file parsing #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yoshi486x
Copy link

Issue

When trying to parse CSA file in a Windows environment, the below error appeared due to not specifying the encoding format.

UnicodeDecodeError: 'cp932' codec can't decode byte 0x86 in position 47: illegal multibyte sequence

Solution

This fix will specify the two encoding formats already used to parse a KIF file which are 'cp932' and 'utf-8-sig'.

return Parser.parse_str(f.read())
except:
pass
return None
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be great if the function raises an exception when we cannot decode as cp932 and utf-8-sig instead of returning None.

@gunyarakun
Copy link
Owner

@yoshi486x
Thank you for your contribution!

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

Successfully merging this pull request may close these issues.

2 participants