checking decode -> encode -> decode consistency