Created
October 18, 2012 02:49
-
-
Save agudulin/3909600 to your computer and use it in GitHub Desktop.
Bash: convert subtitles files into unicode
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 | |
# Usage: | |
# copy this script into the folder with subtitles files | |
# | |
# chmod +x convert_subtitles.sh | |
# ./convert_subtitles.sh *.srt | |
backup="backup_cp1251_srt/"; | |
if [ $# -eq 0 ]; then | |
echo "Give some input files"; | |
else | |
`mkdir -p $backup`; | |
for arg in $@; do | |
`cp $arg $backup`; | |
`iconv -f windows-1251 -t utf-8 $arg > _tmp.srt`; | |
`mv _tmp.srt $arg`; | |
done; | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment