Alasql: How can I customize header with chinese?

Created on 5 Sep 2015  ·  7Comments  ·  Source: agershun/alasql

Hello, I'm using alasql to export data to XLSX now。 When I want to customize column title with chinese, using plain sql like 'SELECT id AS 身份' INTO XLSX("test.xlsx", ?) FROM ?' or 'select id as "身份"', it raises error: "Error: Parse error on line 1:" or "s.replace is not a function". Any solution? Thanks.

! Question Please test

Most helpful comment

Could you try square brackets [ ] with the column name:

    SELECT id AS [身份]' INTO XLSX("test.xlsx", ?) FROM ?

All 7 comments

Hmmm. Interesting.

Seams like we have an UTF8 issue here.

Thanks for letting us know. I will try to make some tests to see where the problem is located

Could you try square brackets [ ] with the column name:

    SELECT id AS [身份]' INTO XLSX("test.xlsx", ?) FROM ?

@agershun Awesome. It works! Maybe it's a trick rarely known, caused by UTF8. For more language supporting(for me , Chinese, haha), I do hope UTF8 issue solved.
Thanks all.

This is not a trick, but the standard functionality. You can use this approach to use spaces, other punctuation characters, and other UTF8 characters. Thank you for the question!

Отправлено с iPhone

4 сент. 2015 г., в 23:20, alexcc4 [email protected] написал(а):

@agershun Awesome. It works! Maybe it's a trick rarely known, caused by UTF8. For more language supporting(for me , Chinese, haha), I do hope UTF8 issue solved.
Thanks all.


Reply to this email directly or view it on GitHub.

@agershun I getting this into the documentation. I dont understand the ´'´ after [身份]' what is the point of this one?

This is a mistake... Just square-brackets [lalala] or back-quotes lalala

:+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mathiasrw picture mathiasrw  ·  5Comments

arnemorken picture arnemorken  ·  6Comments

karubimania picture karubimania  ·  6Comments

AmyBlankenship picture AmyBlankenship  ·  6Comments

morrme picture morrme  ·  5Comments