--怎么将首先转换成Unicode,然后再转换成ASCIIStreamWriter sw = null;
string strCSVData = String.Empty;
String path = ...;
path = System.Web.HttpUtility.UrlDecode( path );try
{
...
//先换成Unicode
sw = new StreamWriter(path,false,Encoding.Unicode);
//?怎么再转换成 ASCII
foreach(...)
{
for(...)
{
strCSVData =;
...
}
strCSVData += "\r\n";
}
sw.WriteLine(strCSVData);
}
catch
{
...
}
finally
{
...
}
string strCSVData = String.Empty;
String path = ...;
path = System.Web.HttpUtility.UrlDecode( path );try
{
...
//先换成Unicode
sw = new StreamWriter(path,false,Encoding.Unicode);
//?怎么再转换成 ASCII
foreach(...)
{
for(...)
{
strCSVData =;
...
}
strCSVData += "\r\n";
}
sw.WriteLine(strCSVData);
}
catch
{
...
}
finally
{
...
}
{
return WideCharToMultiByte(CP_ACP,NULL,unicode,-1,ascii,max_len,NULL,NULL);
}
如果不输出,这样中转有意义吗?直接转成ascii就可以了。
直接转 ASCII ,中文乱码.
想通过先转换成Unicode,然后再转换成ASCII ,解决中文乱码问题.