     @key.indexOf(substring) >= 0
     ## ECMA6: @key.includes substring
   match: (regex) -> @key.match regex
+
+loadSVG = (filename, settings) ->
+  fs.readFileSync filename,
+    encoding: getSetting settings, 'svgEncoding'
+  ## TODO: Handle <?xml encoding="..."?> or BOM to override svgEncoding.
 
 escapeId = (key) ->
   ###

    super()
    for own key, value of options
      @[key] = value
    ## Force SVG namespace when parsing, so nodes have correct namespaceURI.
    ## (This is especially important on the browser, so the results can be
    ## reparented into an HTML Document.)
    @svg = @svg.replace /^\s*<(?:[^<>'"\/]|'[^']*'|"[^"]*")*\s*(\/?\s*>)/,
      (match, end) ->
        unless 'xmlns' in match
          match = match[...match.length-end.length] +

                settings = {...settings, dirname: path.dirname filename}
                data =
                  filename: filename
                  svg: loadSVG filename, settings
              else
                throw new SVGTilerError "Unrecognized extension in filename '#{data}' for symbol '#{key}'"
        else
