Add regression test to catch encoding bug fixed in previous commit