• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
路漫漫其修远兮
博客园    首页    新随笔    联系   管理    订阅  订阅

关于URL编码问题

ASP默认为gb2132,转化函数如下

 

代码
Function  encodeUrl(paraString,Encoding1,Encoding2)
 
'  不同编码的urlencode函数
 '  Encoding1  程序使用的编码  utf-8=65001,GB2312=936
 '  Encoding2  需要得到的编码
 '  by  fisker  07.02.07
  Session.CodePage=Encoding2
  encodeUrl  
=  server.urlencode(paraString)
  Session.CodePage
=Encoding1
 
End  Function 

 

.net 中有Server.UrlEncode()与System.Web.HttpUtility.UrlEncode() 都可以编码.

区别在于:HttpUtility.UrlEncode()默认是以UTF8对URL进行编码,而Server.UrlEncode()则以默认的编码(页面编码一般为utf-8)对URL进行编码。

 

posted @ 2010-07-05 15:10  永生牵恋  阅读(195)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3