update function conv & revert which convert escape codes