Extract charset from HTTP request or HTML.