question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UnicodeEncodeError: 'ascii' codec can't encode characters in position 49-51: ordinal not in range(128) ()

See original GitHub issue

Locale is en_US.UTF-8, python is 2.6.5

Same problem as the other one posted here, but my locale is set correctly. It printed 1 wow

 user@host:~$ doge



                                                                             wow











Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/doge/core.py", line 396, in main
    shibe.print_doge()
  File "/usr/local/lib/python2.6/dist-packages/doge/core.py", line 245, in print_doge
    sys.stdout.write(line)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 49-51: ordinal not in range(128)
()
wow error: Unknown unicode error. 

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
olithrazcommented, Dec 28, 2013

Changing it to decode fails, but changing it to encode worked perfectly. For anyone that finds this in the future with this issue, here is a screenshot of line 245: http://i.imgur.com/IEAqBlw.png

Works perfectly, few unsupported characters, but I should be able to fix that once I’m on a computer http://i.imgur.com/AS5GfaV.png

0reactions
olithrazcommented, Dec 28, 2013

Sounds good! Much welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

UnicodeEncodeError: 'ascii' codec can't encode character u ...
The issue is that when you call str(), python uses the default character encoding to try and encode the bytes you gave it,...
Read more >
Fix Python UnicodeEncodeError: 'ascii' codec can't encode ...
A very common Python error that is raised when working with unicode characters is the UnicodeEncodeError . UnicodeEncodeError: 'ascii' codec can ...
Read more >
UnicodeEncodeError 'ascii' 'ordinal not in range(128)'
- use .encode() or .decode() function but I get a very annoying message: An error occurred while processing the action acknowledgement.
Read more >
'ascii' codec can't encode character '\xe9' in position ... - GitHub
UnicodeEncodeError : 'ascii' codec can't encode character '\xe9' in position 117: ordinal not in range(128) #10604.
Read more >
Python UnicodeEncodeError: 'ascii' codec can't encode ...
This error occurs when you pass a Unicode string containing non-English characters (Unicode characters beyond 128) to something that expects an ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found