Created
October 8, 2015 06:20
-
-
Save blue1st/7d98d466f442cc39048f to your computer and use it in GitHub Desktop.
ファイルのエンコードを変更するワンライナー
This file contains 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
perl -MEncode -i -nle 'Encode::from_to($_,"utf8","cp932");print $_¥r¥n' [FILE] | |
# -MオプションでEncodeモジュールを指定 | |
# -iオプションで一時ファイルを作るよう指定 | |
# -nで引数のファイルを展開して一行ずつ実行 | |
# -lオプションでchompして要らない改行を取り除く | |
# エンコード変換して新たな改行コードを加えて出力する |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment