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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:58:19+00:00 2026-05-20T12:58:19+00:00

I have some lovely (Scandinavian?) user on my website complaining that I cannot parse

  • 0

I have some lovely (Scandinavian?) user on my website complaining that I cannot parse his username in URLs, and hence I am showing him no results on his page on my website.

I am pretty sure that the browser encodes the requests as
http://councilroom.com/player?player=G%C3%B6rling

I’d like to get the player string to become Görling rather than Görling that is getting converted to.

I am using web.py with python 2.6 and attempting to parse the URL as follows

parsed_url = urlparse.urlparse(web.ctx.fullpath)
query_dict = dict(urlparse.parse_qsl(parsed_url.query))
target_player = query_dict['player']

Edit: With the help of unutbu, I fixed this by changing it to

query_dict = dict(urlparse.parse_qsl(web.ctx.env['QUERY_STRING']))
target_player = query_dict['player'].decode('utf-8')

I think webpy was mis-parsing the fullpath in web.ctx somehow, but the QUERY_STRING variable is unmolested.

  • 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-20T12:58:20+00:00Added an answer on May 20, 2026 at 12:58 pm
    In [4]: import urlparse
    
    In [6]: parsed_url = urlparse.urlparse('http://councilroom.com/player?player=G%C3%B6rling')
    
    In [7]: parsed_url
    Out[7]: ParseResult(scheme='http', netloc='councilroom.com', path='/player', params='', query='player=G%C3%B6rling', fragment='')
    
    In [8]: query_dict = dict(urlparse.parse_qsl(parsed_url.query))
    
    In [9]: query_dict
    Out[9]: {'player': 'G\xc3\xb6rling'}
    

    Note the .decode('utf-8'):

    In [10]: target_player = query_dict['player'].decode('utf-8')
    
    In [11]: target_player
    Out[11]: u'G\xf6rling'
    
    In [12]: print(target_player)
    Görling
    

    PS. Somehow, the bytes in the str object 'G\xc3\xb6rling' were being interpreted as a sequence of unicode code points, with the effect of turning Görling into Görling:

    In [3]: print(u'G\xc3\xb6rling')
    Görling
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have some files on our website that users of our software can download.
I have some code that when a user clicks on a link Add Comment,
I have some UI in VB 2005 that looks great in XP Style, but
We have some input data that sometimes appears with &nbsp characters on the end.
I have a dropdownlist that I populate with some stuff: In my controller ViewData[SourceModelList]
We have some input elements on the page: <input type=text class=lovely-input name=number value= />
Using this lovely example I am getting some funky results. What I have is:
Have some audio and video files that users are to download, however depending on
I have some javascript code that is used in a few different pages in
I have some automatic de-serialization code that will set an object's properties using KVC

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.