mblaze/contrib/mrecode

9 lines
193 B
Plaintext
Raw Normal View History

2017-09-06 15:54:30 +00:00
#!/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