Advertisement
overloop

gen script to convert all ansi to utf-8

Oct 24th, 2013
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.20 KB | None | 0 0
  1. #!/bin/bash
  2. ls *.txt | grep -v "^[a-z]" | while read a; do file --mime "$a"; done | grep -v "utf-8" | awk -F':' -v q='"' '{print "iconv -f CP1251 -t UTF-8 " q $1 q " > tmp.tmp && mv tmp.tmp " q $1 q }'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement