Skip to content

Instantly share code, notes, and snippets.

@rocknr011
Created January 27, 2019 10:34
Show Gist options
  • Select an option

  • Save rocknr011/85d0029cdd7c0c7076318045a419b5aa to your computer and use it in GitHub Desktop.

Select an option

Save rocknr011/85d0029cdd7c0c7076318045a419b5aa to your computer and use it in GitHub Desktop.
#!/bin/bash
#iconv.sh
FROM_CP=${1:-"cp1251"}
TO_CP=${2:-"utf-8"}
while read line
do
echo "$line" | iconv -f $FROM_CP -t $TO_CP
done < "${1:-/dev/stdin}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment