Keyword escape mode should escape to %%, not ~.