WriteAllText输出文本乱码的问题
string filename = Server.MapPath( "~/Movie.smi ");
Server.HtmlEncode(filename);
string message = " <smil> <head> </head> <body> <video src=\ " " +FileURL + "\ "/> </body> </smil> ";
File.WriteAllText(filename, message);
Response.Clear();
Response.ClearHeaders();
Response.BufferOutput = false;
Response.ContentType = "application/octet-stream ";
Response.AppendHeader( "Content-Disposition ", "attachment;filename= " + "Movie.smi ");
//Response.AddHeader( "Content-Length ", filename.Length.ToString());
Response.WriteFile( "Movie.smi ");
Response.CacheControl = "no-cache ";
Response.Flush();
File.Delete(filename);
Response.End();
用RealPlayer打开显示这样...rtsp://27.30.248.2/Jx/ZGJJ閮戞柊绔?rm
我把数据库里的内容提取出来输出到smi文件,结果中文显示是乱码...需要怎么改??
[解决办法]
Encoding.GetEncoding( "gb2312 "))