-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Apparently, UTF-8 allows, but does not require, a BOM.
When calling read_to_string on such a file, it panics with StringError("stream did not contain valid UTF-8")
Python, however:
>>> open('before.csv', encoding='utf-8').read()
'\ufeffFirst Name,Last Name,Age,City,Eyes color,Species\nJohn,Doe,32,Tokyo,Blue,Human\nFlip,Helm,12,Canberra,Red,Unknown
\nTerdos,Bendarian,165,Cracow,Blue,Magic tree\nDominik,Elpos,33,Paris,Purple,Orc\nBrad,Doe,42,Dublin,Blue,Human\nEwan,Gr
ath,51,New Delhi,Green,Human\n'Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.