mirror of https://github.com/leahneukirchen/mblaze
contrib/mrecode: assume UTF-8 for unknown-8bit or x-unknown charsets
parent
bb8054c2ff
commit
a02c7e451b
@ -1,8 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# mrecode - recode stdin respecting PIPE_CHARSET into UTF-8
|
# mrecode - recode stdin respecting PIPE_CHARSET into UTF-8
|
||||||
|
|
||||||
if [ -n "$PIPE_CHARSET" ]; then
|
case "$PIPE_CHARSET" in
|
||||||
exec iconv -f "$PIPE_CHARSET" -t UTF-8
|
''|*[Uu][Nn][Kk][Nn][Oo][Ww][Nn]*) exec cat;;
|
||||||
else
|
*) exec iconv -f "$PIPE_CHARSET" -t UTF-8;;
|
||||||
exec cat
|
esac
|
||||||
fi
|
|
||||||
|
Loading…
Reference in New Issue