File: mrecode

package info (click to toggle)
mblaze 1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 792 kB
  • sloc: ansic: 8,391; sh: 1,870; ruby: 128; awk: 22; makefile: 17
file content (8 lines) | stat: -rwxr-xr-x 193 bytes parent folder | download
1
2
3
4
5
6
7
8
#!/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