Fix inspired by this answer: https://stackoverflow.com/a/
63920556/
11502478
[Verification] in Chrome console:
// assume having wav file on the device
input = tizen.filesystem.openFile("documents/sample1.wav", "r")
blob = input.readBlob() /// BlobĀ {size: 1073218, type: ""}
output = tizen.filesystem.openFile("documents/sample1_output.wav", "w")
output.writeBlob(blob)
output.close()
output_test = tizen.filesystem.openFile("documents/sample1_output.wav", "r")
blob_test = output_test.readBlob() /// Blob {size: 1073218, type: ""}
console.log("Verification passed: " + (blob.size === blob_test.size))
input.close()
output_test.close()
TCT (filesystem, deprecated) passrate 100%
Change-Id: I5e4beea31d69430e9dbe44a7899cf675e779c7f8
xhr = new XMLHttpRequest(),
i,
ui8;
+ xhr.overrideMimeType('text/plain; charset=x-user-defined');
xhr.open('GET', uri, false);
xhr.send();
URL.revokeObjectURL(uri);
- var stringUtf8 = unescape(encodeURIComponent(xhr.response));
+
+ var stringUtf8 = xhr.response;
ui8 = new Uint8Array(stringUtf8.length);
+
for (i = 0; i < stringUtf8.length; ++i) {
ui8[i] = stringUtf8.charCodeAt(i);
}