atom-community / atom-community/atom-script

Unicode Encoding Error in Python

Open
#701 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
730
Forks
264
PR merge metrics
No merged PRs in 30d

Description

When I was trying to print some unicode strings, an error occurred:

```
print(u'"Abstract":"' + printAbstract + u'",')
UnicodeEncodeError: 'ascii' codec can't encode character u'\u03b5' in position 513: ordinal not in range(128)
```

So it seems that strings are always encoded in ascii, even though I have declared them to be in unicode form by preceding `u`. However, the code was able to run in Python 2.7.10 Shell. So is there any convention that I should follow in my program or is it a bug?

Thanks :smile:

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.