add_html_to_string: Encode only known unsafe or non-ASCII characters.