added test for double-encoding bug