Encode URLs for the GistHandler