error.sh 513 字节
Newer Older
1 2 3 4 5
#!/bin/sh

printf "Status: 500 Intentional Breakage\n"

printf "Content-Type: "
6
charset=iso-8859-1
7 8 9 10 11 12 13
case "$PATH_INFO" in
*html*)
	printf "text/html"
	;;
*text*)
	printf "text/plain"
	;;
14 15 16 17
*charset*)
	printf "text/plain; charset=utf-8"
	charset=utf-8
	;;
18 19 20 21
*utf16*)
	printf "text/plain; charset=utf-16"
	charset=utf-16
	;;
22 23 24 25
*odd-spacing*)
	printf "text/plain; foo=bar ;charset=utf-16; other=nonsense"
	charset=utf-16
	;;
26 27 28 29
esac
printf "\n"

printf "\n"
30 31
printf "this is the error message\n" |
iconv -f us-ascii -t $charset