with-encoder macro