X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fproto.py;h=1af091f92fb44a5a3dc4aea4f05ab9aae605a096;hb=50be6d543e7a6067b631930a025bfdaf53fedbc4;hp=8c8dcee1b0d54d398fa681d56f9bb12ab1d0f3a5;hpb=3985f4bbbfd3740d955ec766fb5fb912efcb0d59;p=wrw.git diff --git a/wrw/proto.py b/wrw/proto.py index 8c8dcee..1af091f 100644 --- a/wrw/proto.py +++ b/wrw/proto.py @@ -102,10 +102,12 @@ def simpleerror(env, startreq, code, title, msg): return [buf] def urlq(url): + if isinstance(url, unicode): + url = url.encode("utf-8") ret = "" invalid = "&=#?/\"'" for c in url: - if c in invalid or (ord(c) <= 32): + if c in invalid or (ord(c) <= 32) or (ord(c) >= 128): ret += "%%%02X" % ord(c) else: ret += c