fix escaping and charset