Fix problem decoding JSON content without charset.
Improve support for charset handling.