Is your feature request related to a problem? Please describe.
Yes, it raise "UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position 46: illegal multibyte sequence" error
When I add ko_KR.json with Korean character, it shows following error when use.
File "C:\source\py_test\test_i18n.py", line 18, in <module>
d = get_translations("./translations", "ko_KR")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\source\py_test\test_i18n.py", line 13, in get_translations
data: Dict[str, str] = json.load(fp)
^^^^^^^^^^^^^
File "C:\Users\gugu.park\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 293, in load
return loads(fp.read(),
^^^^^^^^^
UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position 46: illegal multibyte sequence
PS C:\source\py_test> python test_i18n.py
Describe the solution you'd like
I want option for encoding when reading json file in get_translations function in loaders.py file
# raise error when Korean character
with open(os.path.join(self.directory, f"{locale}.json")) as fp:
->
# No error when Korean character, so I want "utf-8" as option
with open(os.path.join(self.directory, f"{locale}.json"), encoding="utf-8") as fp:
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe. Yes, it raise "UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position 46: illegal multibyte sequence" error
When I add ko_KR.json with Korean character, it shows following error when use.
Describe the solution you'd like
I want option for encoding when reading json file in
get_translations
function inloaders.py
fileAdditional context
Add any other context or screenshots about the feature request here.