Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
文本可能是 UTF8。
File.ReadAllText(filePath, Encoding.UTF8)
再加上
File.WriteAllText(destinationFile, sb.ToString(), Encoding.UTF8)
应该掩盖处理 Unicode 字符。如果你做一个或另一个,你将得到垃圾输出,要么两者都有,要么什么都没有。