test encoder