a quick look at this library’s dataUrlToBlob() implementation reveals however that it throws away all of the media type parameters! And blindly assumes base64 encoding.
Current implementation:
export function dataURLToBlob (dataURL: string): Blob {
var type = dataURL.match(/data:([^;]+)/)[1]
var base64 = dataURL.replace(/^[^,]+,/, '')
var buff = binaryStringToArrayBuffer(atob(base64))
return createBlob([buff], { type: type })
}
Issues:
A data url without ;base64 appended to the media type should just percent-decode the data.
The type should include its parameters; for example, in text/plain;charset=iso-8859-5 (used with or without the base64-encoding), dropping the charset parameter might result in problems when decoding the blob’s data.
As remarked in #61:
Current implementation:
Issues:
A data url without
;base64
appended to the media type should just percent-decode the data.The type should include its parameters; for example, in
text/plain;charset=iso-8859-5
(used with or without the base64-encoding), dropping the charset parameter might result in problems when decoding the blob’s data.