fix encoding bug in testing