地址栏的要接收的gbk数据 n=%d9%f8%d5%fe 怎么把 接收到的gbk数据 转为 utf-8 数据 能存到数据库里,现在存进去的是????
解决方案 »
- ASP.NET如何不用服务端控件进行开发?
- 怎么变换网页视频样式????
- 数据缓存问题 当天结帖!速度
- GridView中自带的分页那个数字怎么去掉啊 ?
- Asp.net (Tree View )
- 请教能否使用asp.net捆绑硬件
- 关于GridView 中的ImageField 图片显示的问题
- 请问有没有类似于NDoc 但可以用于VS05 Website项目的文档生成工具?或者大家知道给*.aspx.cs里的函数写了xml注释后,有用NDoc生成文档的
- 请问一个小问题
- 请大家推荐一个比较好用的新闻发布系统,谢了
- 在.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该怎么写?