Handle response encoding