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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:37:01+00:00 2026-05-16T00:37:01+00:00

I wanted to url encode a python string and got exceptions with hebrew strings.

  • 0

I wanted to url encode a python string and got exceptions with hebrew strings.
I couldn’t fix it and started doing some guess oriented programming.
Finally, doing mystr = mystr.encode("utf8") before sending it to the url encoder saved the day.

Can somebody explain what happened? What does .encode(“utf8”) do? My original string was a unicode string anyways (i.e. prefixed by a u).

  • 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-16T00:37:02+00:00Added an answer on May 16, 2026 at 12:37 am

    You original string was a unicode object containing raw Unicode code points, after encoding it as UTF-8 it is a normal byte string that contains UTF-8 encoded data.

    The URL encoder seems to expect a byte string, so that it can URL-encode one byte after another and doesn’t have to deal with Unicode code points. When you give it a unicode object, it tries to convert it to a byte string using some default encoding, probably ASCII. For Hebrew characters that cannot be represented as ASCII, this will lead to errors.

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

Sidebar

Ask A Question

Stats

  • Questions 515k
  • Answers 515k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer function page_protect() { global $id; $id = 1234; } page_protect();… May 16, 2026 at 6:33 pm
  • Editorial Team
    Editorial Team added an answer Something similar to this should work: ->select('a.id, a.first_name, a.last_name, a.company,… May 16, 2026 at 6:33 pm
  • Editorial Team
    Editorial Team added an answer Look at the webmail sample of this open source project… May 16, 2026 at 6:33 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Lets say I wanted to build an app that will pull url links from
hello i wanted to create a format for users url, for example for the
I am doing Ajax call using jQuery and my URL is like http://localhost;3327/DummyAps/Demo.aspx In
I've got an extended WebBrowser control which handles the NewWindow3 event. Originally I wanted
From Whats the java equivalent of Python’s urllib.urlencode? Like >>> urllib.urlencode({'abc':'d f', 'def': '-!2'})
I just wanted to check something here - do you have to echo values
I've just upgraded my old wildcard mapping based URL system to use System.Web.Routing .
I wanted to ask if/how is it possible to tag a photo using the
What I wanted to achieve is a logo with png transparency and the background
I'm working on one web application. I wanted to provide interactive debugging to my

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.