Fix for HTML strings containing non-ASCII characters

As proposed by evg1985
Merge branch 'non_ascii_fix'