Issue in decoding the characters #3010
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#3010
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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?
cptable.utils.decode(65001, 'GÜNDÜZ TRAFO ELEKTRİK MAKİNALARI TURİZM', 'str')
getting the wrong decoding
'GDܚ TRAFO ELEKTR렍AKARI TUR'
Please give me solution so I can decode these charcter and other language characters
Assuming the second argument is the correct JS string, you probably meant to encode:
Encoding takes a JS string and encodes in the specified codepage, while decoding takes a string or array of bytes in the codepage and generates a JS-friendly string.
But in practice, you should be passing the option
codepage
to the read or write functions. For example, if you are trying to read Turkish files, it is most likely 1254 (Windows Turkish). To see the full list, check the table in https://git.sheetjs.com/sheetjs/js-codepage#generated-codepagescptable.utils.decode(65001, 'GÜNDÜZ TRAFO ELEKTRİK MAKİNALARI TURİZM', 'str')
As you can see Here I am using decode not encode but getting wrong data in output
wrong data is - 'GDܚ TRAFO ELEKTR렍AKARI TUR'
While I want exact data which I am passing
You are starting from a JS string (assuming
'GÜNDÜZ TRAFO ELEKTRİK MAKİNALARI TURİZM'
is the correct string). That means you probably want to decode.The encode operations take content in a specified encoding and generate JavaScript-friendly strings.
The decode operations take JavaScript-friendly strings and generate content using the specified encoding.
Ok got it, First I have to encode string to make it JavaScript-friendly string and then decode it