Add escaped_write enum and functions