Decoding url with country specific chars (like æøå)

Anders R raskpetersen at
Tue Sep 24 09:05:57 EDT 2002


i had a fustrating experience while doing some url decoding on a
unicode string that contains country specific chars:

The original string (unicode, so it might look strange here):
TestProduct™, opdateret 27/8 Prøver lige en umlaut: ä

The string in encoded form:

the output i get when i decode it with urllib.unquote_plus(var):
TestProduct™, opdateret 27/8 Pr%C3%B8ver lige en umlaut: ä
in case special chars are escaped:
TestProduct™, opdateret 27/8 Pr%C3%B8ver lige en umlaut:

So instead of 'ø' in the (danish) word 'Prøver' isn't decoded correct,
in fact it looks like Python (version 2.1) totally leaves the '%C3%B8'

Can anyone explain this behaviour?

It seems like unicode *is* supported fine, since the TM sign and the ä
(a with umlaut) is translated fine!

Maybe its only us danes getting discriminated ;-O

please help :-S


More information about the Python-list mailing list