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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:29:02+00:00 2026-06-03T00:29:02+00:00

I am receiving web response in different encoding using python and my expected output

  • 0

I am receiving web response in different encoding using python and my expected output should have to same as given on the web page

Ex : Marc Barbé

The last character should remain same after the parsing of html response.

Currently I am using following code for this

unicode.join(u'\n',map(unicode,item))

In some cases when there is no special encoding is given it is throwing following error :
Ex: Markus Rygaard, Alberte Blichfeldt, Flemming Quist, Møller

Traceback (most recent call last):
  File "BFICrawl.py", line 20, in <module>
    print attrName + " : " + attrValue
  File "C:\Python27\LIB\encodings\cp437.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\xf8' in position 6
0: character maps to <undefined>

I really not able to find the reason for the same. Is there any alternate way available for getting the same encoding content from web.

  • 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-03T00:29:03+00:00Added an answer on June 3, 2026 at 12:29 am

    You have successfully obtained unicode objects from the web. You should not need to do things like unicode.join(u'\n',map(unicode,item)). The problem is happening when you try to output the unicode.

    You are running your script in a Windows “Command Prompt” window. The script is printing to the console. The console encoding is cp437. That is a very limited (8-bit) encoding. It can’t handle the second character in Møller, and an enormous bunch of other characters

    Remedy: Run your script in IDLE (supplied with your Python) or some other IDE.

    Alternatively, if you are printing to the console for debug purposes only, instead of print foo use print repr(foo)

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

Sidebar

Related Questions

I have 2 different XMLHttpRequest objects making asynchronous requests to the same web service.
What options are available for receiving instant alerts from web applications? I have a
I am sending and receiving web requests with HttpWebRequest. After a response it is
I'm receiving a JSON response from a web service, but for various reasons I
I'm using KSOAP2 to invoke a web service. I am getting a response, but
I have an ajax heavy web-application built using PHP, jQuery. I am looking for
I am sending a request to webservice and am receiving correct response from web
I am making a web service call and receiving a JSON formatted response. After
I'm creating a web page that user can send pm , receive it,add contact,response
I'm writing some code for web development using Google Python Appengine. In my code

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.