-
Notifications
You must be signed in to change notification settings - Fork 29
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
Workaround for Japanese Windows environment #108
Conversation
example: mkdir -p .dist
python3 expand.py -o .dist/convolution.rs convolution
python3 expand.py -o .dist/dsu.rs dsu
python3 expand.py -o .dist/fenwicktree.rs fenwicktree
python3 expand.py -o .dist/lazysegtree.rs lazysegtree
python3 expand.py -o .dist/math.rs math
python3 expand.py -o .dist/maxflow.rs maxflow
python3 expand.py -o .dist/mincostflow.rs mincostflow
python3 expand.py -o .dist/modint.rs modint
python3 expand.py -o .dist/scc.rs scc
python3 expand.py -o .dist/segtree.rs segtree
python3 expand.py -o .dist/string.rs string
python3 expand.py -o .dist/twosat.rs twosat
python3 expand.py -o .dist/all.rs --all |
In Python on Japanese Windows, the default 日本語Windows環境でのPythonでは、テキストファイル入出力時にデフォルトとなる With no encoding, source code written in utf-8 (where non-ASCII characters (such as エンコーディング無指定だと、utf-8で書かれたソースコード ( コメント内に
When running on PowerShell, the encoding and newline characters of the PowerShell上で実行してしまうと、標準出力された文字列のエンコーディングや改行文字が変換されてしまう事があり、ファイルにリダイレクト出力する際の対策が面倒くさくなるため、直接ファイル出力できるオプションを追加してみました (PowerShell上ではなく、コマンドプロンプト上で実行するなら問題なさそうですが…。PowerShell (バージョン6以降) でも、リダイレクトではなくパイプで |
- Avoiding problems with incorrect encoding `UnicodeDecodeError: 'cp932' codec can't decode byte 0x85 in position 2897: illegal multibyte sequence` - Added option to output directly to file PowerShell converts encoding and newline characters when passing stdout
Rebase commit to current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Merging.
UnicodeDecodeError: 'cp932' codec can't decode byte 0x85 in position 2897: illegal multibyte sequence
PowerShell converts encoding and newline characters when passing stdout