Last active
May 11, 2016 15:28
-
-
Save rixtox/4fbb3aa521b3f05e13ec to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
if [ -z "$1" ]; then | |
SRC="." | |
else | |
SRC="$1" | |
fi | |
if [ -z "$2" ]; then | |
ENCODING="gb18030" | |
else | |
ENCODING="$2" | |
fi | |
if [ -z "$3" ]; then | |
DESTI="UTF-8" | |
else | |
DESTI="$3" | |
fi | |
mkdir -p "${SRC}/out" | |
find "${SRC}/"* -maxdepth 0 -type f -name "*.ass" -exec sh -c "iconv -f \"${ENCODING}\" -t \"${DESTI}\" \"{}\" > \"${SRC}/out/{}\" " \; |
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
find * -maxdepth 0 -type f -name "*.ass" -exec file -i {} \; | |
find * -maxdepth 0 -type f -name "*.ass" -exec sh -c "iconv -f gb18030 -t UTF-8 \"{}\" > \"./out/{}\" " \; | |
# zh_CN: gb18030 | |
# ja_JP: CP932 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment