diff --git a/websearch.py b/websearch.py index 0105a1e..eae5b2c 100755 --- a/websearch.py +++ b/websearch.py @@ -16,6 +16,7 @@ import random import os import sys assert sys.version_info >= (3, 6), "At least Python 3.8 required due to fStrings. Replace all f\"…\" and comment this line to enable running in lower versions (but really, you should just update your Python version…)." +import base64 ##################################### ######## configuration @@ -71,7 +72,7 @@ args["outputfilename"] = outputfilename searchresult = osmsearch.OSMSearch(args) gpxcontent = searchresult.gpxfile.to_xml() -gpxcontent_escaped = searchresult.gpxfile.to_xml().replace("\\", "\\\\").replace("'", "\\'").replace('"', '\\"') +gpxcontent_base64 = base64.b64encode(gpxcontent.encode("utf-8")).decode("utf-8") print(""" @@ -80,20 +81,6 @@ print("""