Actually fix the utf8 encoding bug. Now all unit tests pass.