improve performance for html_encodeTagged