Fix charts with utf8-bom encoding

This commit is contained in:
LoveEevee 2020-10-29 15:21:53 +03:00
parent 9aa7375287
commit c5ce5104f1

View File

@ -62,9 +62,12 @@ class GdriveFile{
}
read(encoding){
if(encoding){
return this.arrayBuffer().then(response =>
new TextDecoder(encoding).decode(response)
)
return this.arrayBuffer().then(response => {
var reader = new FileReader()
var promise = pageEvents.load(reader).then(event => event.target.result)
reader.readAsText(new Blob([response]), encoding)
return promise
})
}else{
return gpicker.downloadFile(this.id)
}