Last active
July 15, 2017 06:03
-
-
Save tosik/c2c767fd468018b302ff659fec50a845 to your computer and use it in GitHub Desktop.
Xamarin Studio が BOM を複数つけたりするので、それを探し出すジャンクコード
This file contains hidden or 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
bom = [0xEF, 0xBB, 0xBF] | |
double_bom = bom + bom | |
Dir::glob("#{ARGV[0]}/**/*.cs").each do |path| | |
f = File.open(path, "rb") | |
s = f.read | |
f.close | |
head = s[0..5].unpack("C*") | |
if head == double_bom | |
puts path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment