Skip to content

Instantly share code, notes, and snippets.

@tosik
Last active July 15, 2017 06:03
Show Gist options
  • Save tosik/c2c767fd468018b302ff659fec50a845 to your computer and use it in GitHub Desktop.
Save tosik/c2c767fd468018b302ff659fec50a845 to your computer and use it in GitHub Desktop.
Xamarin Studio が BOM を複数つけたりするので、それを探し出すジャンクコード
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