App engine issue with special chars...

17 views
Skip to first unread message

SebastianB

unread,
Aug 26, 2011, 2:25:00 PM8/26/11
to Google App Engine
I'm testing gae/python.... i have a very very simple issue on HTTP
Request..... (what i can't solve yet..)
everything is working fine.... (http request is handled on MICLASE,
etc......) except what if i enter "la niña" on descri textbox.
(index.html) i get "la nia" on web browser after submit....
this happen on production env. with both (GET / POST) methods....... i
think this is an encoding issue...... (but i can't know how to fix
it)...
if i use GET method my web browser (chrome) is sent "descri=la+ni%F1a"
as query string (what i think is correct).

can anyone explain it ?

index.html:
<html><body><form action="url_to" method="post"><input type="text"
name="descri"><input type="submit"></form></body></html>


class MICLASE(webapp.RequestHandler):
def get(self):
p_descri=self.request.get('descri')
self.response.out.write(p_descri)


-----------------------------------------------------------------------------

Kaan Soral

unread,
Aug 26, 2011, 3:21:23 PM8/26/11
to Google App Engine
maybe a meta tag problem?

Do you view the source?

Ernesto Oltra

unread,
Aug 27, 2011, 12:57:14 AM8/27/11
to google-a...@googlegroups.com
Maybe the problem is not the form, but the "see-it" page. Try this too:

class MICLASE(webapp.RequestHandler): 
 def get(self):
 
  self.response.headers['Content-Type'] = 'text/plain; charset=utf-8'
  p_descri=self.request.get('descri') 
  self.response.out.write(p_descri) 

Reply all
Reply to author
Forward
0 new messages