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

Chinese character not supported. #60

Closed
TankyH opened this issue Sep 28, 2016 · 2 comments
Closed

Chinese character not supported. #60

TankyH opened this issue Sep 28, 2016 · 2 comments
Labels

Comments

@TankyH
Copy link

@TankyH TankyH commented Sep 28, 2016

In [18]: array = [['这', '是', '中', '文'], ['这', '是', '中', '文']]

In [19]: pyexcel.Sheet(array)

Out[19]: ---------------------------------------------------------------------------
UnicodeEncodeError Traceback (most recent call last)
...
UnicodeEncodeError: 'ascii' codec can't encode characters in position 58-61: ordinal not in range(128)

chfw added a commit that referenced this issue Sep 28, 2016
chfw added a commit that referenced this issue Sep 28, 2016
@chfw
Copy link
Member

@chfw chfw commented Sep 28, 2016

Reproduced in python 2. The root cause is the sys.getdefaultencoding() equals "ascii", which obviously could not encode Chinese texts. However, the fix is not extended to python-texttable which produces distorted output(Chinese characters should have been counted to occupy two spaces of an alphabet). Therefore, the fix only removes the UnicodeEncodeError in python 2.

Please verify using the master branch:

pip install https://github.com/pyexcel/pyexcel/archive/master.zip 
@chfw chfw added the bug label Oct 1, 2016
chfw added a commit that referenced this issue Oct 3, 2016
@chfw
Copy link
Member

@chfw chfw commented Oct 28, 2016

released in v0.3.0

@chfw chfw closed this Oct 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants