Windows.Storage.FileIo.WriteTextAsync
方法有两个重载,有和没有文本编码。
然而,MSDN pages该方法的(主页或任一重载页面)未指定没有编码参数的方法使用的编码。
那么默认使用什么编码呢?
其他问题:类似这样的内容可能在某处 中有记录。那么如何从MSDN中查找相关资料呢?它是按照某种我看不到的模式组织的吗?
最佳答案
看一下带编码参数的重载方法:
Remarks
This method attempts to automatically detect the encoding of a file based on the presence of byte order marks. If an encoding cannot be detected, the encoding specified by the caller is used.
这就是第一种方法在没有最后一句话的情况下如何工作:
This method attempts to automatically detect the encoding of a file based on the presence of byte order marks.
如果无法检测到编码,Encoding.Default Property被使用。
关于c# - FileIO.WriteTextAsync(file, text) 使用什么编码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18608357/