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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:19:33+00:00 2026-05-30T13:19:33+00:00

\Hi All, A user is entering a unicode value (u’\u2206′) into a text box

  • 0

\Hi All,

A user is entering a unicode value (u’\u2206′) into a text box that is submitted to my django view. The view uses the GET data to generate a URL to get back to the search page later.

It’s having trouble generating the URL when the user submits a unicode charactor.

What is the best practice here. Should I encode the get data before sending it into urlencode? What encoding should I use?

Relevant code:

search_form = SearchForm(request.GET)
get_data = dict([(key,item) for (key,item) in search_form.data.items()])
get_params = '&' + urllib.urlencode(query=get_data.items())

Error:
Traceback (most recent call last):

  File "/opt/python/lib/python2.7/site-packages/django/core/handlers/base.py", line 100, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/opt/python/lib/python2.7/site-packages/django/contrib/auth/decorators.py", line 25, in _wrapped_view
    return view_func(request, *args, **kwargs)

  File "/opt/DjangoProjects/Fly/FlyStore/views.py", line 465, in search
    get_params = '&' + urllib.urlencode(query=get_data.items())

  File "/opt/python/lib/python2.7/urllib.py", line 1282, in urlencode
    v = quote_plus(str(v))

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2206' in position 15: ordinal not in range(128)
  • 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-30T13:19:34+00:00Added an answer on May 30, 2026 at 1:19 pm

    Encode as UTF-8 before URL-encoding.

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

Sidebar

Related Questions

I'm working on a service that needs to detect user states for all user(s)
I want a query that returns a list of all the (user) stored procedures
What is the best way to simulate a user entering text in a text
Trying to check if a text box is visible then the user should enter
I'm using this code to stop the user from entering numeric values into the
I have a multiple Activity application that progresses the user from entering an IP/Host
so i use mysql_real_escape_string to sanitize some user input before entering it into the
All, I would like to collect stats on what users are entering into my
Looking to do a security audit of all user permissions. I think I can
I need to enumerate all the user defined types created in a SQL Server

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.