how to read file as ut8? #3128
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#3128
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
cant read csv file with cyrilyc
"xlsx": "^0.18.5"
node.js 14
macos
SheetJS is consistent with Excel in that the default codepage is used to interpret CSV data. Modern text editors tend to use UTF8 as the default encoding.
There are two ways to force UTF8 interpretation:
Ensure that the file starts with the UTF8 BOM (
\xEF\xBB\xBF
).Explicitly pass the option
codepage: 65001
toXLSX.read
.i call this command on my macos
is it correct file?
file -I upload_afd2e045490707e4784134a22456c776.csv
upload_afd2e045490707e4784134a22456c776.csv: text/plain; charset=utf-8
This explanation will be added somewhere in the docs.
Consider the following content:
The UTF8 encoded version, including the BOM, is
i3128-utf8-bom.csv
and has the following contents:This file has the UTF8 BOM so Excel will treat it as UTF8.
The version without a BOM is
i3128-utf8-nobom.csv
:Excel tries to interpret it using the default codepage. In English (United States) you see the following mess:
SheetJS produces a similar mess:
The
file
command applies heuristics to determine the MIME type and charset. It does not care about the presence of the BOM. Other tools, including Apple Numbers, will assume UTF8 encoding by default.so what can help me?
https://docs.sheetjs.com/docs/api/parse-options#parsing-options pass the option
codepage: 65001
toXLSX.readFile
doesnt work, what else?
You probably want to
resolve(x)
. If you are having further issues, join the chat