Note:  This is clearly incorrect for many strings,
but is the only consistent approach within the current
servlet framework.  It must suffice until servlet output
streams properly encode their output.