Fix an encoding issue, add a test.