encoding tests