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

  • Home
  • SEARCH
  • 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 90847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:56:15+00:00 2026-05-10T22:56:15+00:00

Any thoughts on why this isn’t working? I really thought ‘ignore’ would do the

  • 0

Any thoughts on why this isn’t working? I really thought ‘ignore’ would do the right thing.

>>> 'add \x93Monitoring\x93 to list '.encode('latin-1','ignore') Traceback (most recent call last):   File '<interactive input>', line 1, in ? UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 4: ordinal not in range(128) 
  • 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. 2026-05-10T22:56:15+00:00Added an answer on May 10, 2026 at 10:56 pm

    … There’s a reason they’re called "encodings" …

    A little preamble: think of unicode as the norm, or the ideal state. Unicode is just a table of characters. №65 is latin capital A. №937 is greek capital omega. Just that.

    In order for a computer to store and-or manipulate Unicode, it has to encode it into bytes. The most straightforward encoding of Unicode is UCS-4; every character occupies 4 bytes, and all ~1000000 characters are available. The 4 bytes contain the number of the character in the Unicode tables as a 4-byte integer. Another very useful encoding is UTF-8, which can encode any Unicode character with one to four bytes. But there also are some limited encodings, like "latin1", which include a very limited range of characters, mostly used by Western countries. Such encodings use only one byte per character.

    Basically, Unicode can be encoded with many encodings, and encoded strings can be decoded to Unicode. The thing is, Unicode came quite late, so all of us that grew up using an 8-bit character set learned too late that all this time we worked with encoded strings. The encoding could be ISO8859-1, or windows CP437, or CP850, or, or, or, depending on our system default.

    So when, in your source code, you enter the string "add “Monitoring“ to list" (and I think you wanted the string "add “Monitoring” to list", note the second quote), you actually are using a string already encoded according to your system’s default codepage (by the byte \x93 I assume you use Windows codepage 1252, “Western”). If you want to get Unicode from that, you need to decode the string from the "cp1252" encoding.

    So, what you meant to do, was:

    "add \x93Monitoring\x94 to list".decode("cp1252", "ignore") 

    It’s unfortunate that Python 2.x includes an .encode method for strings too; this is a convenience function for "special" encodings, like the "zip" or "rot13" or "base64" ones, which have nothing to do with Unicode.

    Anyway, all you have to remember for your to-and-fro Unicode conversions is:

    • a Unicode string gets encoded to a Python 2.x string (actually, a sequence of bytes)
    • a Python 2.x string gets decoded to a Unicode string

    In both cases, you need to specify the encoding that will be used.

    I’m not very clear, I’m sleepy, but I sure hope I help.

    PS A humorous side note: Mayans didn’t have Unicode; ancient Romans, ancient Greeks, ancient Egyptians didn’t too. They all had their own "encodings", and had little to no respect for other cultures. All these civilizations crumbled to dust. Think about it people! Make your apps Unicode-aware, for the good of mankind. 🙂

    PS2 Please don’t spoil the previous message by saying "But the Chinese…". If you feel inclined or obligated to do so, though, delay it by thinking that the Unicode BMP is populated mostly by chinese ideograms, ergo Chinese is the basis of Unicode. I can go on inventing outrageous lies, as long as people develop Unicode-aware applications.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question isn't really for any specific technology but more of general developer question.
Does anyone have any thoughts on this method? I have did some performance testing
I've been researching memory mapped files for a project and would appreciate any thoughts
My code works (yeah!) which sends json to a server.. would appreciate any thoughts
I know this isn't hard, but I'm not having any luck. I want to
Any thoughts on using Flex to build an RIA for administering a complex rails
Anyone have any thoughts on how/if it is possible to integrate Google Code commits
Visual Studio randomly crashes when adding/removing references and projects. Any thoughts why? Will installing
What are the benefits of upgrading from Visual Studio 2005 to 2008? Any thoughts
Anyone have any comparative thoughts on these three technologies? Each addresses a different VM,

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.