Skip to content

Instantly share code, notes, and snippets.

@umpirsky
Last active January 25, 2018 11:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umpirsky/de358718fa1733f26d0dd1bf65c60a99 to your computer and use it in GitHub Desktop.
Save umpirsky/de358718fa1733f26d0dd1bf65c60a99 to your computer and use it in GitHub Desktop.
Nautilus script for converting subtitle encoding from Windows-1250 to utf-8
#!/bin/sh
# chardetect orignial
IFS_BAK=$IFS
IFS="
"
for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
iconv -f Windows-1250 -t utf-8//IGNORE $line > $line.tmp
mv $line.tmp $line
done
IFS=$IFS_BAK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment