Created
October 29, 2011 10:36
-
-
Save rgo/1324325 to your computer and use it in GitHub Desktop.
Convert files to utf-8 with vim
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
## From http://stackoverflow.com/questions/2311750/change-file-encoding-to-utf-8-via-vim-in-a-script | |
#This is the simplest way I know of to do this easily from the command line: | |
vim +"argdo se bomb | se fileencoding=utf-8 | w" $(find . -type f -name *.rb) | |
#Or better yet if the number of files is expected to be pretty large: | |
find . -type f -name *.rb | xargs vim +"argdo se bomb | se fileencoding=utf-8 | w" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment