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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:31:41+00:00 2026-06-08T10:31:41+00:00

I am using Google App Engine for Python, but I get a unicode error

  • 0

I am using Google App Engine for Python, but I get a unicode error is there a way to work around it?
Here is my code:

def get(self):
    contents = db.GqlQuery("SELECT * FROM Content ORDER BY created DESC")
    output = StringIO.StringIO()
    with zipfile.ZipFile(output, 'w') as myzip:
        for content in contents:
            if content.code:
                code=content.code
            else:
                code=content.code2
            myzip.writestr("udacity_code", code)

    self.response.headers["Content-Type"] = "application/zip"
    self.response.headers['Content-Disposition'] = "attachment; filename=test.zip"
    self.response.out.write(output.getvalue())

I now get a unicode error:

UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xf7 in position 12: ordinal not in range(128)

I believe it is coming from output.getvalue()… Is there a way to fix this?

  • 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-08T10:31:42+00:00Added an answer on June 8, 2026 at 10:31 am

    @Areke Ignacio’s answer is the fix. For a brief walkthrough here is a post I did recently “Python and Unicode Punjabi” https://www.pippallabs.com/blog/python-and-unicode-panjabi

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

Sidebar

Related Questions

I'm trying to get this function working in Google App Engine using Python: def
I am using Google App Engine (python), I want my users to be able
I'm using Google App Engine python. I want to know what browser the user
I'm using Google App Engine (Python) and Chanel api. Is it possible to show
I am using google app engine in python with a Jinja2 template engine. This
I've been developing a Facebook app using Google App Engine in Python and the
So I have a python webapp on Google App Engine and am using the
I'm working on a project, using Python running on Google App Engine. The project
How can i send Chat invitation over GTalk using Google App Engine(Python), i was
I'm using the Google App Engine with Python (Django). How to emulate SELECT *

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.