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

The Archive Base Latest Questions

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

Following this thread solution, I have managed to get a bunch of lists that

  • 0

Following this thread solution, I have managed to get a bunch of lists that each looks like:

[u’\u05ea\u05d0\u05de\u05d9\u05df \u05dc\u05d9′]

I assume that those are unicode character but for some reason, I can’t convert them back into Hebrew.

I tried the suggested solution in the comments in the link. I also tried to use ''.join but it didn’t work. The error I get is:

Error Type: exceptions.UnicodeEncodeError 22:42:15 T:2806414192
M:2425589760 ERROR: Error Contents: ‘ascii’ codec can’t encode
characters in position 0-4: ordinal not in range(128)

I tried to wrap stuff in unicode() but all I got is the same as the example above.

How do I achieve that?

Note:
I am trying to parse this link.

Edit:
I am trying to convert the list into string using join and then print it. Here is the relevant pice of code:

soup = BeautifulStoneSoup(link, convertEntities=BeautifulStoneSoup.XML_ENTITIES)
    programs = soup('ul')
    for i,prog in enumerate(programs):
        if i==(4+getLetterValue(name)):
            j = 0
            while j < len(prog('li')):
                li = prog('li')[j]
        link = li('a')[0]
        url = link['href']
                text = link.contents
                print ''.join(text)

link is a string. and getLetterValue(name) returns an integer which tells what is the position in the html document.

  • 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-25T03:13:47+00:00Added an answer on May 25, 2026 at 3:13 am

    This is a unicode string, it is in Hebrew and you can even print it directly on a Python interactive shell. e.g.:

    >>> print u'\u05ea\u05d0\u05de\u05d9\u05df \u05dc\u05d9'
    תאמין לי
    

    If you really need to convert it to a raw string of bytes (a str object) for some reason, you have to specify the encoding of the byte string because text can represented in many different encodings.

    Short answer: assuming you want to use UTF-8 to encode the text, you can use:

    your_unicode_text.encode('utf-8')
    

    If you are going to use a different encoding, just change the encoding name above.

    For a reference on how Python deals with Unicode text and common problems, see: http://docs.python.org/howto/unicode.html

    See also this answer for another short explanation of Unicode and string encodings.

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

Sidebar

Related Questions

In this thread some one commented that the following code should only be used
I have a C# program that executes a thread. Inside this thread, I have
I have a method that contains an asynchronous call like this: public void MyMethod()
I have been trying to get it to work using this thread but can't
Following this question: Good crash reporting library in c# Is there any library like
I'm following this walkthrough: http://msdn.microsoft.com/en-us/library/879kf95c(VS.80).aspx In a machine running vista ultimate, I have installed:
I have this POSIX thread: void subthread(void) { while(!quit_thread) { // do something ...
I have a worker thread that needs to add items to a BindingList .
I have an interface defined like this @interface PageViewController : UIImageView { ... }
In my C# program, I have a thread that represents a running test, which

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.