set content-type, content-charset, and not content-encoding

Patches originally by adoliver, rebased for current master branch.

Content-Encoding should only be set by the HTTP server, not by us.