2007-01-19, 02:22
Hi,
i try to update my kino.de script at the moment. Now i ran into some problem:
if i want to get cinemadata from citys with no umlaut or special character everythings works well, but if i try to fetch pages from citys with umlaut, i get the wrong page, because the umlauts or special characters are wrong encoded (i think)
so here is the code snipped:
if i enter the url in my browser i get the right side:
for example:
München:
http://kino.de/kinosuche.php4?searchortplz=M%FCnchen
but with the urlopen i get the side from
http://kino.de/kinosuche.php4?searchortplz=M%25FCnchen
so in the form on the page is "M%FCnchen" written instead of the wanted "München"
please help!
Tia
Morte
i try to update my kino.de script at the moment. Now i ran into some problem:
if i want to get cinemadata from citys with no umlaut or special character everythings works well, but if i try to fetch pages from citys with umlaut, i get the wrong page, because the umlauts or special characters are wrong encoded (i think)
so here is the code snipped:
PHP Code:
def getPage(self, city, pages):
# city comes from a list of unicode strings!
url = 'http://kino.de/kinosuche.php4?searchortplz='
url = url + urllib.quote(city,'/=&:?')
self.filmContentText.setText(url)
debugwrite(str(url))
pagetext = urllib.urlopen(str(url)).read()
pagetext = pagetext.decode('iso-8859-1')
self.filmContentText.setText(pagetext)
self.HTMLPage = pagetext
for example:
München:
http://kino.de/kinosuche.php4?searchortplz=M%FCnchen
but with the urlopen i get the side from
http://kino.de/kinosuche.php4?searchortplz=M%25FCnchen
so in the form on the page is "M%FCnchen" written instead of the wanted "München"
please help!
Tia
Morte