zachary822 / chinese-converter

Converts between traditional and simplified Chinese
https://pypi.org/project/chinese-converter/
MIT License
25 stars 8 forks source link

Specify UTF-8 encoding #1

Closed victorangeloblancada closed 3 years ago

victorangeloblancada commented 3 years ago

Specified UTF-8 encoding in line 11 to avoid UnicodeDecodeError.

zachary822 commented 3 years ago

Can you write a test case for this change?

victorangeloblancada commented 3 years ago

Sorry, I think I was unclear. I only specified in lines 11 and 14 that the .json and .txt files are UTF-8. This was done because I got a UnicodeDecodeError when I tried to import the library after installing using pip. The error won't show up in tests in the test folder because it comes up right when the library is imported. I ran the modified code through the tests in the methods of the TestTranslator class in test_translator.py and I'm not getting any errors. Kindly let me know if you need me to provide anything else.