diff --git a/src/previous-map.js b/src/previous-map.js index 24c7a42..ffc1f79 100644 --- a/src/previous-map.js +++ b/src/previous-map.js @@ -36,8 +36,10 @@ export default class PreviousMap { } decodeInline(text) { + let utfd64 = 'data:application/json;charset=utf-8;base64,'; + let utf64 = 'data:application/json;charset=utf8;base64,'; + let b64 = 'data:application/json;base64,'; let uri = 'data:application/json,'; - let base64 = 'data:application/json;base64,'; if ( this.startWith(text, uri) ) { return decodeURIComponent( text.substr(uri.length) ); @@ -45,6 +47,12 @@ export default class PreviousMap { } else if ( this.startWith(text, base64) ) { return Base64.decode( text.substr(base64.length) ); + } else if ( this.startWith(text, utf64) ) { + return Base64.decode( text.substr(utf64.length) ); + + } else if ( this.startWith(text, utfd64) ) { + return Base64.decode( text.substr(utfd64.length) ); + } else { let encoding = text.match(/data:application\/json;([^,]+),/)[1]; throw new Error('Unsupported source map encoding ' + encoding);