首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

请教一个转码有关问题,没明白是什么转码,请大家看看

2013-01-06 
请问一个转码问题,没明白是什么转码,请大家看看汉字:专家称近期气温以偏低为主,是否“寒冬”不能确定编码:4e

请问一个转码问题,没明白是什么转码,请大家看看
汉字:

专家称近期气温以偏低为主,是否“寒冬”不能确定

编码:
4e135bb679f08fd1671f6c146e294ee5504f4f4e4e3a4e3bff0c662f5426201c5bd251ac201d4e0d80fd786e5b9a


------------------


请问这个是什么编码,我能得到编码,怎么转成汉字?

多谢!

[解决办法]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = "4e135bb679f08fd1671f6c146e294ee5504f4f4e4e3a4e3bff0c662f5426201c5bd251ac201d4e0d80fd786e5b9a";
            byte[] bytes = Regex.Matches(s, "[0-9a-fA-F]{2}").Cast<Match>().Select(x => (byte)Convert.ToInt16("0x" + x.Value, 16)).ToArray();
            var result1 = System.Text.UnicodeEncoding.BigEndianUnicode.GetString(bytes, 0, bytes.Length);
            Console.WriteLine(result1);
        }
    }
}

热点排行