title: Fixing encoded string for Google Maps polyline
body: <p>I have an encoded string I want to use to draw a line in google maps, but Javascript can't read the string because of special characters such as the backslash. Unfortunately I don't have much experience with Javascript, and I have no idea how to escape these characters.</p>
  
  <p>Encoded string:</p>
  
  <pre><code>qikrIehwu@WOKEIAIBGN?RAj@@f@?RGVO`NOhOSvQSdTUxUUbVUhVCdCEfC{@rUe@`LCt@KjDC`@NPfBl@nA\dH`@nFTh@BdDVPBb@LNJLNHPLn@B\NFNAlB_@^EjAKnAArABjIx@fGr@jG`AtHhAlIrArJxAvKbBhLfBnLdBhLjBxLfB|LnBxLjB`LbBlLdBfL~@hKv@lKn@vKx@lK\|Jd@dADfO[lL]pLWrLY~L_@~LWlABtHx@xOzEjAf@vCxAlCjBjCfC`CxChFrJfBrEzA`FxG~XtEvSlElRZvAXhAtApEDNDHHDLAFSFUFMLMLUDKBO@OB_@?Q?YC[GUOg@I_@COUy@M[MKMG?OEQAOCVPoALsA@QHa@JIDSKO
  </code></pre>
  
  <p>What I've tried so far:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;Filtered Data&lt;/title&gt;
      &lt;style type="text/css"&gt;
        html, body { height: 100%; margin: 0; padding: 0; }
        #map { height: 100%; }
      &lt;/style&gt;
  
      &lt;script type="text/javascript"&gt;
        var map;
  
        function initMap() {
          map = new google.maps.Map(document.getElementById('map'), {
            center: { lat: 55.570, lng: 9.000 },
            zoom: 13
          });
  
          RegExp.escape = function(s) {
            return s.replace(/\\/g, '&amp;#92;');
          };
  
          var encoded_data = RegExp.escape("qikrIehwu@WOKEIAIBGN?RAj@@f@?RGVO`NOhOSvQSdTUxUUbVUhVCdCEfC{@rUe@`LCt@KjDC`@NPfBl@nA\dH`@nFTh@BdDVPBb@LNJLNHPLn@B\NFNAlB_@^EjAKnAArABjIx@fGr@jG`AtHhAlIrArJxAvKbBhLfBnLdBhLjBxLfB|LnBxLjB`LbBlLdBfL~@hKv@lKn@vKx@lK\|Jd@dADfO[lL]pLWrLY~L_@~LWlABtHx@xOzEjAf@vCxAlCjBjCfC`CxChFrJfBrEzA`FxG~XtEvSlElRZvAXhAtApEDNDHHDLAFSFUFMLMLUDKBO@OB_@?Q?YC[GUOg@I_@COUy@M[MKMG?OEQAOCVPoALsA@QHa@JIDSKO");
          var decode = google.maps.geometry.encoding.decodePath(encoded_data);
  
          var line = new google.maps.Polyline({
            path: decode,
            strokeColor: '#00008B',
            strokeOpacity: 1.0,
            strokeWeight: 4,
            zIndex: 3
          });
  
          line.setMap(map);
        }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="map"&gt;&lt;/div&gt;
      &lt;script async defer
          src="https://maps.googleapis.com/maps/api/js?libraries=geometry,drawing&amp;callback=initMap"&gt;
      &lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>