test encoder decoder