Repository navigation
Fix error in Windows in zh_CN locale - #51
Merged
Merged
Conversation
By default python in Windows in zh_CN will use GBK to open files, since we're using UTF-8 now, it will throw error like this:
Traceback (most recent call last):
File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python310\Scripts\fortls.exe\__main__.py", line 7, in <module>
File "C:\Program Files\Python310\lib\site-packages\fortls\__init__.py", line 56, in main
LangServer(
File "C:\Program Files\Python310\lib\site-packages\fortls\langserver.py", line 119, in __init__
) = load_intrinsics()
File "C:\Program Files\Python310\lib\site-packages\fortls\intrinsics.py", line 168, in load_intrinsics
intrin_file = json.load(fid)
File "C:\Program Files\Python310\lib\json\__init__.py", line 293, in load
return loads(fp.read(),
UnicodeDecodeError: 'gbk' codec can't decode byte 0x99 in position 11899: illegal multibyte sequence
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
=======================================
Coverage 81.34% 81.34%
=======================================
Files 9 9
Lines 4305 4305
=======================================
Hits 3502 3502
Misses 803 803
Continue to review full report at Codecov.
|
Member
|
@lixiang810 Nice catch! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By default python in Windows in zh_CN will use GBK to open files, since we're using UTF-8 now, it will throw error like this: