#!/bin/sh printf "Status: 500 Intentional Breakage\n" printf "Content-Type: " setglobal charset = 'iso-8859-1' match $PATH_INFO { with *html* printf "text/html" with *text* printf "text/plain" with *charset* printf "text/plain; charset=utf-8" setglobal charset = 'utf-8' with *utf16* printf "text/plain; charset=utf-16" setglobal charset = 'utf-16' with *odd-spacing* printf "text/plain; foo=bar ;charset=utf-16; other=nonsense" setglobal charset = 'utf-16' } printf "\n" printf "\n" printf "this is the error message\n" | iconv -f us-ascii -t $charset