Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't use chinese in datasource #10

Closed
JjiaoLiu opened this issue Apr 1, 2017 · 8 comments · Fixed by #13
Closed

can't use chinese in datasource #10

JjiaoLiu opened this issue Apr 1, 2017 · 8 comments · Fixed by #13

Comments

@JjiaoLiu
Copy link

JjiaoLiu commented Apr 1, 2017

const dataSource = [{
key: '1',
name: "冰冰",
age: 32,
address: "胡迪"
}, {
key: '2',
name:"冰冰",
age: 42,
address: "胡迪"
}];

const columns = [{
title: '姓名',
dataIndex: 'name',
key: 'name',
}, {
title: '年龄',
dataIndex: 'age',
key: 'age',
}, {
title: '住址',
dataIndex: 'address',
key: 'address',
}];
This is my datasource.
data

it does not support chinese?

@abdennour
Copy link
Collaborator

Did you want to render Chinese headers ? I mean : key, name, age, address .

@tonylkc
Copy link

tonylkc commented Apr 4, 2017

@abdennour Hi! I have the same problem that, both header and content have to output in Chinese. However the output is garbled now.

@JjiaoLiu
Copy link
Author

JjiaoLiu commented Apr 5, 2017

I can output header in English,no wrong.but I also need to output content in chinese;
Uploading QQ截图20170405091635.png…

@jiangbing9293
Copy link

使用BOM的方式解决,在数据开始添加 \uFEFF。
修改core.js
encodeURI('data:text/csv;charset=utf-8,\uFEFF' + toCSV(data, headers, separator))
encodeURI(data:text/csv;charset=utf-8,\uFEFF${toCSV(data, headers, separator)})

@abdennour
Copy link
Collaborator

abdennour commented Apr 13, 2017

@jiangbing9293 :
شكرا لك على هذه الإشارة اللطيفة .

@abdennour
Copy link
Collaborator

Associated NPM 🚚 release is : 1.0.6 .


@JjiaoLiu @tonylkc : Please, let me know if it is fixed from your side .

@estmatic
Copy link

I think that \uFEFF character shouldn't have a comma after it. As it is, I get an extra blank heading, so the column headings and values don't match.

@JjiaoLiu
Copy link
Author

so cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants