add some more logging. don't assume utf-8 if we can't parse charset