LoginSignup
0
0

More than 3 years have passed since last update.

cygwinで処理したデータをPowerShellへ渡すときはShift-JISがよさげです

Posted at

時代の流れに従って、cygwinでもUTF-8が使えますので、デフォルトをUTF-8にしています。
ところが、Windows10でPowerShellを使ってみるとUTF-8は特殊設定が必要なようです。
ポーティングやリプレースを考えると、デフォルトからの設定変更は少ない方が良いです。

まとめ

PowerShellからCygwin(bash)を呼び出したときは、ja_JP.SJISにする。
そのために、~/.bashrc末尾に以下を追記

~/.bashrc
# PowerShellから呼び出し時だけShift-JISにする
if [ $PPID -eq 1 ]
then
        export LANG=ja_JP.SJIS
fi
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0