revert curling and encoding