This project has moved. For the latest updates, please go here.

Convert UTF8 to ASCII. How?

Topics: User Forum
Apr 11, 2012 at 12:11 PM

I have a UTF8 HTML file that I process with HAP but I really want the resulting HTML to be in 7-bit format, i.e. with UTF8 chars encoded/esacaped (e.g. ø -> &oslash;) but <> and so on should be preserved as they are. What is the best way to do this? The only solution I have found so far is to manually check each an every character of the HTML file and convert it with HTMLencode from HTMLutility if necessary. This seems slow and cumbersome but is it the only way?

Apr 11, 2012 at 1:29 PM

I found this solution using Intellisense :)

string sevenbit = HtmlEntity.Entitize(utf8string, true, false);

This seems to do the trick just nicely. But is it possible to have HAP do this automatically instead of me explicitly having to code it?