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 8470569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:33:22+00:00 2026-06-10T16:33:22+00:00

I want to compare Technical Diploma (±12 years) with the same string present in

  • 0

I want to compare Technical Diploma (±12 years) with the same string present in the browser. I am running a webdriver test in Python where it fetches Technical Diploma (±12 years) from a db and tries to compare with a string present in the browser. I am getting this error when I try to compare

UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode – interpreting them as being unequal

How do I compare these non-ASCII strings in Python?

  • 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-06-10T16:33:23+00:00Added an answer on June 10, 2026 at 4:33 pm

    One of your strings is not a unicode value, but a bytestring. You want to convert that to unicode by decoding it first:

    'Non-ASCII value containing UTF8: \xc2\xb1'.decode('utf8')
    

    but you will have to figure out what encoding the bytestring is in in the first place.

    If you have defined a source file encoding and you are defining the string as a literal in your code, make sure you define it as a Unicode literal by prefixing the string with a u'':

    u'Technical Diploma (±12 years)'
    

    I strongly recommend you read up on the Python Unicode HOWTO before you proceed, however.

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

Sidebar

Related Questions

I want to compare the alpha channel from one image to ~1000 other images.
I want to compare the first few bytes in byte[] with a string. How
I want to compare two text files that i have generated from one of
I want to compare string which is date. I am trying following linq query,
I want to compare two dates with time, I want all the results from
I want to compare the value of an NSString to the string Wrong. Here
I want to compare if an variable A represents the same object as variable
I want to compare two dates; one taken from a Date column in SQL
I want to compare and count rows in the same datatabe. myDataTable hours_id(PK) |
I want to compare a string literal that is failed to a string that

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.