简体   繁体   English

如果我的程序仅适用于 Unicode 编码文件,我是否可以考虑如果没有提供 BOM,编码是 UTF-8 没有 BOM?

[英]If my program will work ONLY with Unicode encoded files, can I consider that if BOM is not presented, encoding is UTF-8 without BOM?

My question namely is "Are UTF-16 and UTF-32 encoded files considered correct if BOM is not presented?"我的问题是“如果不提供 BOM,UTF-16 和 UTF-32 编码的文件是否被认为是正确的?”

I worked on it and found that BOM is optional for UTF-16 and UTF-32, it`s considered good practice to ask the user about encoding if BOM is not presented.我对其进行了研究,发现 BOM 对于 UTF-16 和 UTF-32 是可选的,如果没有提供 BOM,向用户询问编码是一种很好的做法。 I got information from this article .我从这篇文章中得到了信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM