Last active
May 2, 2020 06:17
-
-
Save koba-yu/dd635d8bdf3c232f184814b48cdb97fc to your computer and use it in GitHub Desktop.
C#で指定フォルダのファイルを全てShift-JISからUTF-8に変換する
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
void Main() | |
{ | |
foreach (var file in Directory.EnumerateFiles(@"ここにフォルダを指定")) | |
{ | |
var content = File.ReadAllText(file, Encoding.GetEncoding("Shift_JIS")); | |
if(content.Length == 0) | |
continue; | |
File.WriteAllText(file, content, Encoding.GetEncoding("UTF-8")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment