Skip to content

Instantly share code, notes, and snippets.

@umpirsky
Last active January 25, 2018 11:54
Show Gist options
  • Select an option

  • Save umpirsky/de358718fa1733f26d0dd1bf65c60a99 to your computer and use it in GitHub Desktop.

Select an option

Save umpirsky/de358718fa1733f26d0dd1bf65c60a99 to your computer and use it in GitHub Desktop.

Revisions

  1. umpirsky revised this gist Jan 25, 2018. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions convert
    Original file line number Diff line number Diff line change
    @@ -7,9 +7,8 @@ IFS="
    "

    for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
    cp $line $line.bak
    iconv -f Windows-1250 -t utf-8//IGNORE $line.bak > $line.tmp
    iconv -f Windows-1250 -t utf-8//IGNORE $line > $line.tmp
    mv $line.tmp $line
    done

    IFS=$IFS_BAK
    IFS=$IFS_BAK
  2. umpirsky revised this gist Dec 20, 2017. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions convert
    Original file line number Diff line number Diff line change
    @@ -7,9 +7,9 @@ IFS="
    "

    for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
    iconv -f Windows-1250 -t utf-8 $line > $line.tmp
    rm $line
    cp $line $line.bak
    iconv -f Windows-1250 -t utf-8//IGNORE $line.bak > $line.tmp
    mv $line.tmp $line
    done

    IFS=$IFS_BAK
    IFS=$IFS_BAK
  3. umpirsky created this gist Aug 24, 2016.
    15 changes: 15 additions & 0 deletions convert
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/sh

    # chardetect orignial

    IFS_BAK=$IFS
    IFS="
    "

    for line in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS; do
    iconv -f Windows-1250 -t utf-8 $line > $line.tmp
    rm $line
    mv $line.tmp $line
    done

    IFS=$IFS_BAK