Created
May 3, 2013 23:26
-
-
Save imzjy/5515078 to your computer and use it in GitHub Desktop.
create the GBK to UTF-8(with BOM)
This file contains hidden or 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
#!/bin/sh | |
#convert from GBK to UTF-8(with BOM) | |
#http://stackoverflow.com/questions/4364156/iconv-converting-from-windows-ansi-to-utf-8-with-bom | |
for file in `find . -iname $1 ` | |
do | |
echo -ne '\xEF\xBB\xBF' > "$file.new" | |
iconv -f GBK -t 'UTF-8' "$file" >> "$file.new" && | |
mv -f "$file.new" "$file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment