Adapt tests to work with encodings other than utf-8