diff options
author | Leah Neukirchen <leah@vuxu.org> | 2020-08-08 16:53:06 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2020-08-08 16:53:06 +0200 |
commit | a02c7e451bbaab8ef497d302447e99756b037baf (patch) | |
tree | dd801e3250fe546f0320f51381c86da3787d7f26 /contrib | |
parent | bb8054c2ffa3397990b91a9245e5dd35bd41ecc4 (diff) | |
download | mblaze-a02c7e451bbaab8ef497d302447e99756b037baf.tar.gz mblaze-a02c7e451bbaab8ef497d302447e99756b037baf.tar.xz mblaze-a02c7e451bbaab8ef497d302447e99756b037baf.zip |
contrib/mrecode: assume UTF-8 for unknown-8bit or x-unknown charsets
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/mrecode | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/mrecode b/contrib/mrecode index 45a00a7..69e97b4 100755 --- a/contrib/mrecode +++ b/contrib/mrecode @@ -1,8 +1,8 @@ #!/bin/sh # mrecode - recode stdin respecting PIPE_CHARSET into UTF-8 -if [ -n "$PIPE_CHARSET" ]; then - exec iconv -f "$PIPE_CHARSET" -t UTF-8 -else - exec cat -fi +case "$PIPE_CHARSET" in + ''|*[Uu][Nn][Kk][Nn][Oo][Ww][Nn]*) exec cat;; + *) exec iconv -f "$PIPE_CHARSET" -t UTF-8;; +esac + |