     @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) ->
   ###

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

    super()
    for own key, value of options
      @[key] = value
    @svg = @svg
    ## Remove initial SVG/XML comments such as <?xml...?> and <!DOCTYPE>
    ## (spec: https://www.w3.org/TR/2008/REC-xml-20081126/#NT-prolog)
    ## for the next replace rule.
    .replace /^\s*|^<\?[^]*?\?>\s*|<![^-][^]*?>|<!--[^]*?-->/g, ''
    ## 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.)
    .replace /^<(?:[^<>'"\/]|'[^']*'|"[^"]*")*\s*(\/?\s*>)/,
      (match, end) ->
        unless 'xmlns' in match
          match = match[...match.length-end.length] +
