Created
May 20, 2014 10:48
-
-
Save CvX/1052a8dc7c9c6a83c5dc to your computer and use it in GitHub Desktop.
Fin offending utf chars
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
Dir.glob(File.join('**', '*.coffee')).each do |path| | |
File.open(path, 'r+') do |file| | |
string = file.read | |
string.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '') | |
file.rewind | |
file.write(string) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment