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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:05:31+00:00 2026-05-14T04:05:31+00:00

it works fine on 64 bit machines but for some reason will not work

  • 0

it works fine on 64 bit machines but for some reason will not work on python 2.4.3 on a 32-bit instance.

i get the error

'utf8' codec can't decode bytes in position 76-79: invalid data

for the code

try:        
    str(sourceresult.sourcename).encode('utf8','replace')
except:
    raise Exception(  repr(sourceresult.sourcename ) )

it returns ‘kazamidori blog\xf9’

i have modified my site.py file to make UTF8 the default encoding, but still doesnt seem to be working.

  • 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-14T04:05:32+00:00Added an answer on May 14, 2026 at 4:05 am

    We need the following, and we need the exact output:

    type(sourceresult.sourcename) # I suspect it's already a UTF-8 encoded string
    
    repr(sourceresult.sourcename)
    

    Like I said, I’m almost certain that your sourceresult.sourcename is already a UTF-8 encoded string.

    Perhaps this might help a little.

    EDIT: it seems your sourceresult.sourcename is encoded as cp1252. I don’t know what mystring (that you reference in a comment) is.
    So, to get a UTF-8 encoded string, you need to do:

    source_as_UTF8= sourceresult.sourcename.decode("cp1252").encode("utf-8")
    

    However, the string being cp1252-encoded is not consistent with the error message you supplied.

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

Sidebar

Related Questions

Currently my code below works fine but it's a bit of overkill. In my
TortoiseSVN works fine on Vista 64 bit for the user account who installed it.
works fine on the desktop with xampp but when i upload it to my
Git works fine on my dev box, but ever so often, I'll go to
This works fine: GET /mvc/Movies/TitleIncludes/Lara%20Croft When I submit a request that contains a colon,
This is bit of a general question but I wanted to know some different
For some reason I can't get Nexus to serve my SNAPSHOT artifacts via the
I am running GDB 7.2 on Linux 64 bit machine. It all works fine
Hi i have the following code which works fine in my machine but when
Everything works fine when the unit tests class is part of the main project

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.