Preserving the internal encoding for the tests. This hopefully fixes subsequent tests when runnin all via runtests.py.