我正在通过电子邮件地址作为网址的一部分,url中的电子邮件地址
例如, http://example.com/hello/[email protected]
但是,当传递给应用程序控制器时,它将更改为“user%40hotmail.com”。
我似乎无法理解这个特殊字符逃跑;混乱。 请帮我解释一下这个问题,以及我能做些什么来解决它。
我正在使用python的“webapp”web应用程序框架。
我正在通过电子邮件地址作为网址的一部分,url中的电子邮件地址
例如, http://example.com/hello/[email protected]
但是,当传递给应用程序控制器时,它将更改为“user%40hotmail.com”。
我似乎无法理解这个特殊字符逃跑;混乱。 请帮我解释一下这个问题,以及我能做些什么来解决它。
我正在使用python的“webapp”web应用程序框架。
它被URL编码。
您需要对其进行解码。
我想我可能应该使用,urllib2.ubquote(“email%40domain.com”) 这似乎工作 – phoenix24 2010-04-13 16:07:32
'ubquote'不会工作,但'unquote'会:) – 2010-04-13 16:09:17
另请参阅http://stackoverflow.com/questions/814700/http-url-allowed-characters-in-parameter-names,http://stackoverflow.com/questions/1828958/is-character-inside-url -segment-allowed和http://stackoverflow.com/questions/912811/what-is-the-proper-way-to-url-encode-unicode-characters。 – 2010-04-13 16:04:14