Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7601705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:13:46+00:00 2026-05-30T23:13:46+00:00

Ho would I properly encode the following: # # -*- coding: utf-8 -*- >>>

  • 0

Ho would I properly encode the following:

# # -*- coding: utf-8 -*-

>>> 'What\x80\x99s Up: Balloon to the Rescue!'.encode('utf-8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0x80 in position 4: ordinal not in range(128)
>>> 'What\x80\x99s Up: Balloon to the Rescue!'.decode('utf-8')
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
 File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x80 in position 4: invalid start byte
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:13:47+00:00Added an answer on May 30, 2026 at 11:13 pm

    You’ve got two issues here. First, your UTF-8 byte sequence is wrong; it should be \xe2\x80\x99. You are also using the wrong function; you need to decode it from UTF-8:

    >>> print 'What\xe2\x80\x99s Up: Balloon to the Rescue!'.decode('utf-8')
    What’s Up: Balloon to the Rescue!
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What would be the best way to properly concatenate string with an url inside?
There is unordered list , which not works properly in IE6-7, I would like
I would like to do the following: import StringIO, uu my_data = StringIO.StringIO() #
In 2010, would you serve URLs containing UTF-8 characters in a large web portal?
I have a MySQL table properly set to the UTF-8 character set. I suspect
I've just setup Mcrypt properly in my framework and thought it would be sweet
The following query works properly to pull company names from one table into jquery
I need to encode a Java String to display properly as part of an
I would like the version property of my application to be incremented for each
I would like to programmatically set maxLength property of TextView as I don't want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.