Change encoding in HTML strings. (Made independent from HTMLTidy)