Skip to content

Instantly share code, notes, and snippets.

@yous
Created February 6, 2015 10:55
Show Gist options
  • Save yous/084f464d402a4a491c91 to your computer and use it in GitHub Desktop.
Save yous/084f464d402a4a491c91 to your computer and use it in GitHub Desktop.
Normalize file name in Windows
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