查看: 1686|回复: 4
|
中文的URL Parameter (Encoding?)
[复制链接]
|
|
我的URL parameter里需要放中文字,例如
xxx.aspx?param1=中文字
但是在destination page那里我只拿到三个问号。
我发现一些中文网站有用一些很像encoding的方法,把中文字转换过后才放进URL的parameter,例如
xxx.aspx?param1=%C1%D6%BF%A1%BD%DC
请问要怎样做?
ps: 我用ASP.NET + C#
谢谢! |
|
|
|
|
|
|
|
发表于 24-7-2007 05:24 PM
|
显示全部楼层
|
|
|
|
|
|
|

楼主 |
发表于 25-7-2007 09:46 AM
|
显示全部楼层
不行咧...
跟content type和charset有关吗? |
|
|
|
|
|
|
|
发表于 25-7-2007 11:36 AM
|
显示全部楼层
HttpUtility is in the System.Web Namespace. By default, class libraries don't reference System.Web namespace, which is probably why HttpUtility is inaccessible.
You need to add a reference to System.Web in your class library by
* right-clicking "References"
* clicking "Add Reference"
* choosing System.Web in the .NET Tab
* clicking the OK button
Then you will either need to add
"using System.Web;" in your class file
or use the entire path of
"System.Web.HttpUtility.UrlEncode(...)" in your class. |
|
|
|
|
|
|
|
发表于 25-7-2007 01:15 PM
|
显示全部楼层
回复 #1 chuinkit 的帖子
很简单罢了,
把全部要past来past去的都encode 去 UTF-8 吗可以咯。
如果有用到javascript来past的话就用encodeForURL()的function来encode 咯
是不是很简单呢 |
|
|
|
|
|
|
| |
本周最热论坛帖子
|