extract method string encoder from encode