Created
February 6, 2015 10:55
-
-
Save yous/084f464d402a4a491c91 to your computer and use it in GitHub Desktop.
Normalize file name in Windows
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
require 'unicode' | |
Dir.glob('*') do |f| | |
normalized_f = Unicode::normalize_C(f) | |
if f != normalized_f | |
puts "Renaming #{f} to #{normalized_f}" | |
File.rename(f, normalized_f) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment