double quote is not read correctly #2270

Closed
opened 2021-04-08 07:29:06 +00:00 by sakahiro · 3 comments
sakahiro commented 2021-04-08 07:29:06 +00:00 (Migrated from github.com)

Thanks for awesome library!

here is my csv

test1,test2,test3
aa"a,bbb,ccc

and my code

let data = new Uint8Array((this.file as unknown) as ArrayBufferLike)
const encodedData = Encoding.convert(data, { to: 'UNICODE', from: encode, type: 'string' })
const workbook = XLSX.read(encodedData, { type: 'string', raw: true })

I expect it's parsed like blow

スクリーンショット 2021-04-08 16 22 44

but actually like this
スクリーンショット 2021-04-08 16 25 14

RFC said

If double-quotes are used to enclose fields, then a double-quote
appearing inside a field must be escaped by preceding it with
another double quote

https://tools.ietf.org/html/rfc4180#section-2

is it expected behavior?

Thanks for awesome library! here is my csv ``` test1,test2,test3 aa"a,bbb,ccc ``` and my code ```.js let data = new Uint8Array((this.file as unknown) as ArrayBufferLike) const encodedData = Encoding.convert(data, { to: 'UNICODE', from: encode, type: 'string' }) const workbook = XLSX.read(encodedData, { type: 'string', raw: true }) ``` I expect it's parsed like blow <img width="188" alt="スクリーンショット 2021-04-08 16 22 44" src="https://user-images.githubusercontent.com/11728422/113985010-a834bc00-9886-11eb-8d93-ffcf29aa1e9a.png"> but actually like this <img width="256" alt="スクリーンショット 2021-04-08 16 25 14" src="https://user-images.githubusercontent.com/11728422/113985389-10839d80-9887-11eb-88e4-2938e2b7940f.png"> RFC said ``` If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote ``` https://tools.ietf.org/html/rfc4180#section-2 is it expected behavior?
gauravd08 commented 2021-05-31 11:13:07 +00:00 (Migrated from github.com)

I am also facing same..

Please resolve this

I am also facing same.. Please resolve this
bgamrat commented 2021-07-27 18:27:02 +00:00 (Migrated from github.com)

+1 - double-quote in a field within a TSV is causing corrupted parsing

+1 - double-quote in a field within a TSV is causing corrupted parsing
MarioFreightos commented 2022-01-04 16:47:39 +00:00 (Migrated from github.com)

Hi everyone, thanks for this awesome package... I saw this is closed in the commit 7a00f39... but I downloaded version 0.17.4 and it doesn't work for me. Same case than @sakahiro . What should I do?

Hi everyone, thanks for this awesome package... I saw this is closed in the commit 7a00f39... but I downloaded version 0.17.4 and it doesn't work for me. Same case than @sakahiro . What should I do?
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2270
No description provided.