fix encoding bug in tests