diff --git a/lib/mbtiles.js b/lib/mbtiles.js index c7fc7e3..f8a50ee 100644 --- a/lib/mbtiles.js +++ b/lib/mbtiles.js @@ -31,8 +31,11 @@ MBTiles.schema = fs.readFileSync(__dirname + '/schema.sql', 'utf8'); // - callback: Will be called when the resources have been acquired // or acquisition failed. require('util').inherits(MBTiles, require('events').EventEmitter) -function MBTiles(uri, callback) { - if (typeof uri === 'string') uri = url.parse(uri, true); +function MBTiles(uri, callback) { + if (typeof uri === 'string') { + uri = url.parse(uri, true); + uri.pathname = qs.unescape(uri.pathname); + } else if (typeof uri.query === 'string') uri.query = qs.parse(uri.query); if (!uri.pathname) {