encoding cleanup for html renderings