I this won't work with utf8-encoded javascript files. 

evaluateJavaScript accepts QString, and f.read() returns bytes. From PyQT docs: "If Qt expects a QString then PyQt4 will accept a unicode, a str that contains only ASCII characters, a QChar or a QByteArray." So QString will most likely try to decode these bytes from ASCII. For this to work reliably I think we should require utf8-encoded js files and decode them from utf8 before passing to PyQT.