当前位置: 移动技术网 > IT编程>开发语言>.net > asp.net下UTF-7转GB2312编码的代码(中文)

asp.net下UTF-7转GB2312编码的代码(中文)

2017年12月12日  | 移动技术网IT编程  | 我要评论

托鲁克玛托,360特供机ak47,2013最好看的电视剧

复制代码 代码如下:

/// utf-7转换gb2312编码的方法
/// </summary>
/// <param name="str7"></param>
/// <returns></returns>
public static string utf72unicode(string str7)
{
string sutf7 = "";
if (str7.startswith("&"))
{
sutf7 = "+" + str7.substring(1);
}
else
{
sutf7 = str7;
}
byte[] bytes = system.text.encoding.getencoding("gb2312").getbytes(sutf7);
byte[] byteret = system.text.encoding.convert(system.text.encoding.utf7, system.text.encoding.unicode, bytes);
string sret = system.text.encoding.unicode.getstring(byteret);
return sret;
}

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网