mimick codec.[en|de]code behaviour with default encoding