It's about encoding issue. #18

Open
opened 2019-11-13 23:26:15 +00:00 by LEEBYOUNGSIK · 2 comments
LEEBYOUNGSIK commented 2019-11-13 23:26:15 +00:00 (Migrated from github.com)

I'm a Korean developer using Sheetsjs.
I'd like to export file in csv. For that, I used sheet_to_csv util.
And I need to have the csv file encoded in euc-kr, now it's utf-8 with BOM.
And I also know that codepage utils. But I couldn't find any euc-kr type in codepage utils.
So I tried to do that with cp949. But I failed to encode hangul.
Here's my code and screen shot.

How can I solve this issue?

var encData = cptable.utils.encode(949, sheet, 'str'); console.log(encData);

and its results are below.
encodingCap

Thank you for your cooperation in advance.

I'm a Korean developer using Sheetsjs. I'd like to export file in csv. For that, I used sheet_to_csv util. And I need to have the csv file encoded in euc-kr, now it's utf-8 with BOM. And I also know that codepage utils. But I couldn't find any euc-kr type in codepage utils. So I tried to do that with cp949. But I failed to encode hangul. Here's my code and screen shot. How can I solve this issue? `var encData = cptable.utils.encode(949, sheet, 'str'); console.log(encData);` and its results are below. ![encodingCap](https://user-images.githubusercontent.com/43466399/68908983-35f2a180-0790-11ea-87d3-fc4eb173a231.PNG) Thank you for your cooperation in advance.
tracker1 commented 2019-11-15 22:13:10 +00:00 (Migrated from github.com)

Just curious, what are you sending the CSV file to? Since many/most systems should be able to import from UTF-8 with or without (may want to strip it) BOM...

Just curious, what are you sending the CSV file to? Since many/most systems should be able to import from UTF-8 with or without (may want to strip it) BOM...
LEEBYOUNGSIK commented 2019-11-18 05:27:05 +00:00 (Migrated from github.com)

I have to send csv file to Excel. In Korea, especially, 2010 version, we need to export csv file encoded in 'euc-kr'. Of course I tried to export csv file encoded in utf-8 with BOM. But there was a bug. Anyway I need to export csv file to excel encoded in 'euc-kr'. How can I do that?
Thank you for your cooperatrion in advance.

I have to send csv file to Excel. In Korea, especially, 2010 version, we need to export csv file encoded in 'euc-kr'. Of course I tried to export csv file encoded in utf-8 with BOM. But there was a bug. Anyway I need to export csv file to excel encoded in 'euc-kr'. How can I do that? Thank you for your cooperatrion in advance.
Sign in to join this conversation.
No Milestone
No project
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/js-codepage#18
No description provided.