Ensure the test runner decodes files as UTF-8 (#2246)
* Ensure the test runner decodes files as UTF-8
Before this change, the `document.charset` of the HTML test files would be 'windows-1252' when accessed through the `file://` protocol, resulting in issues with library or test files containing non-ASCII symbols.
This patch ensures tests still run correctly when files contain non-ASCII symbols.
* Ensure ASCII-safety of source code