fixed: when non ASCII character in .profile on CJK Windows #125
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.
I use GWSL.
And, I got error.
I research.
I found the cause of this error to be the following.
In Japanese Windows, the default system character set is cp932 (Shift_JIS).
Therefore, Python also basically tries to handle strings as cp932.
However, in GNU/Linux, the character encoding of files is basically ASCII or UTF-8.
At least, it will be more than cp932.
Therefore, when reading `.profile', it is better to expect UTF-8 and read it with a higher success rate.
Therefore, I basically rewrote the wsl.exe process to assume that the return value of the process is UTF-8 and decode it.