地址栏的要接收的gbk数据 n=%d9%f8%d5%fe 怎么把 接收到的gbk数据 转为 utf-8 数据 能存到数据库里,现在存进去的是????
解决方案 »
- SQL如何发送HTTP请求?关于OAcreate
- 关于引用JS时出现错误:缺少对象
- asp.net能做出长得像普通应用程序的页面吗?
- 各位大哥大姐给点建议
- WebPart问题,求救!!!!!!!!!!!!!!
- 一次登录之后在各个子网站中,无需再次登录是怎么验证的?
- 各位高手帮帮忙,有个问题要请教一下。在线等。
- 达人们进来,看看我的这段注册程序
- Bitmap bitmap = new Bitmap(stream) 无效参数??
- 请问如何控制crystal report输出的chart的清晰程度?
- 在.net2.0框架运行正常,一转到3.5或4.0就异常
- 多个UpdatePanel,只定时刷新其中一个,怎么做?急!急!
static void Main(string[] args)
{
String str = "测试数据";
Encoding gb2312 = Encoding.GetEncoding("GB2312");
Byte[] gb2312Bytes = gb2312.GetBytes(str); // Test starts: GB2312 bytes are what you have now
Console.WriteLine("============= GB2312 bytes ================");
foreach (Byte b in gb2312Bytes)
{
Console.Write("{0:x} ", b);
}
Console.WriteLine();
Console.WriteLine("==========================================="); String str1 = gb2312.GetString(gb2312Bytes);
//Console.WriteLine(str1);
Byte[] utf8Bytes = Encoding.UTF8.GetBytes(str1); // Test result: UTF-8 bytes are what you want
Console.WriteLine("============= UTF-8 bytes =================");
foreach (Byte b in utf8Bytes)
{
Console.Write("{0:x} ", b);
}
Console.WriteLine();
Console.WriteLine("===========================================");
Console.ReadLine();
}程序输出结果:
============= GB2312 bytes ================
b2 e2 ca d4 ca fd be dd
===========================================
============= UTF-8 bytes =================
e6 b5 8b e8 af 95 e6 95 b0 e6 8d ae
===========================================
<globalization requestEncoding="gb2312" responseEncoding="gb2312"/>,不需任何解密转换,即可
String str = Request.QueryString["n"];
Response.Write(str);
mb_convert_encoding(str, "UTF-8", "GBK"); asp.net该怎么写?