Encoding tests.