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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:24:25+00:00 2026-06-01T12:24:25+00:00

So in short my case is this: Read data from RSS feed Print content

  • 0

So in short my case is this:

  • Read data from RSS feed
  • Print content to the terminal

And of course the content isn’t in plain ascii, it’s utf-8, so I get characters like “öäå”. But when I print the text it’s all mangled up with ecapes like ‘\xe4’. Something to do with the encoding but I just can’t get my head around this. This should be so trivial to do yet google fu is letting me down.

One example is when I’m going through the content word by word and trying to find the character “ö”: I do:

if u"ö" in word:

Which just gives: UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 6…

Edit:

So I think I found my problem. I was getting the feed items then just doing str(entry.content) and passing that onwards, but that entry.content was a list holding a dictionary with unicode strings as values, so what I did (I guess) was just getting an ascii representation of the dictionary content…

  • 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-01T12:24:26+00:00Added an answer on June 1, 2026 at 12:24 pm

    You’re trying to compare encoded text to unicode. Python doesn’t know the encoded text is UTF-8, so it guesses it’s ASCII and tries to decode it to unicode for you. The solution is to decode it explicitly with the proper encoding.

    Check out the Python Unicode HOWTO for more info.

    I can reproduce your problem with this file:

    # coding: utf-8
    
    word = "öäå"
    if u"ö" in word:
        print True
    

    And fix it with this file:

    # coding: utf-8
    
    word = "öäå".decode('utf-8')
    if u"ö" in word:
        print True
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this case <WrapPanel> <CheckBox>Really long name</CheckBox> <CheckBox>Short</CheckBox> <CheckBox>Longer again</CheckBox> <CheckBox>Foo</CheckBox> <Slider MinWidth=200
I used the following piece of code to read data from files as part
I have a rather long switch-case statement. Some of the cases are really short
Short: how does modelbinding pass objects from view to controller? Long: First, based on
Short version: assuming I don't want to keep the data for long, how do
I am launching many threads simultaneously, each one writing / reading data into/from a
First of all, I got this huge xml file that represents data collected by
I use $_POST to read data sent through HTML forms to the server, narrowing
The Story There is a writer thread, periodically gathering data from somewhere (in real-time,
I have an application that uses the bluetooth to receive some data (bytes) from

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.