日期:2014-05-17  浏览次数:20975 次

求解 以下格式怎么转换成UTF-8




还有这么一种
当前是第6封信
邮件日期:Fri, 15 Nov 2013 13
发信人:whuan@dandu.net 
收信人:dengyuanrong2010@163.com 
邮件主题:sssgggggageegegegeg
邮件内容:
------_=_NextPart_001_afa25d99ffad492cb014e9622d4d9ef8
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64

Z2Vhc2ljbmJpbGlhZW5nYWR2YWV0YWdxCgo=

------_=_NextPart_001_afa25d99ffad492cb014e9622d4d9ef8
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: base64

Z2Vhc2ljbmJpbGlhZW5nYWR2YWV0YWdxJm5ic3A7PGJyPjxicj48ZGl2IGRhdGEtaWQ9Im1haWxf
c2lnbl9wYW5lbCI+PC9kaXY+PGRpdiBpZD0iYWFhIj48L2Rpdj4=

------_=_NextPart_001_afa25d99ffad492cb014e9622d4d9ef8--
解码

------解决方案--------------------
楼主是要转成 string 吧
string str = @"Z2Vhc2ljbmJpbGlhZW5nYWR2YWV0YWdxJm5ic3A7PGJyPjxicj48ZGl2IGRhdGEtaWQ9Im1haWxf
c2lnbl9wYW5lbCI+PC9kaXY+PGRpdiBpZD0iYWFhIj48L2Rpdj4=";
str = "Z2Vhc2ljbmJpbGlhZW5nYWR2YWV0YWdxCgo=";
string message = Encoding.UTF8.GetString(Convert.FromBase64String(str));

------解决方案--------------------

byte[] bytes = Convert.FromBase64String("Z2Vhc2ljbmJpbGlhZW5nYWR2YWV0YWdxCgo=");
Console.WriteLine(Encoding.GetEncoding("utf-8").GetString(bytes));

------解决方案--------------------
楼主自己什么都不想做啊,核心的内容是 base64,其他的自己拆解啊
------解决方案--------------------
这个东东是分隔符,每封邮件都是不一样的:
------_=_NextPart_001_afa25d99ffad492cb014e9622d4d9ef8