mblaze/contrib/mrecode

9 lines
193 B
Bash
Executable File

#!/bin/sh
# mrecode - recode stdin respecting PIPE_CHARSET into UTF-8
case "$PIPE_CHARSET" in
''|*[Uu][Nn][Kk][Nn][Oo][Ww][Nn]*) exec cat;;
*) exec iconv -f "$PIPE_CHARSET" -t UTF-8;;
esac