ad-hoc encoding