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.
我正在尝试使用 iconv 将 UTF-16BE 编码文件(字节顺序标记:0xFE 0xFF)转换为 UTF-8,如下所示:
iconv -f UTF-16BE -t UTF-8 myfile.txt
然而,结果输出具有 UTF-8 字节顺序标记 (0xEF 0xBB 0xBF),这不是我需要的。有没有办法告诉 iconv (或是否有等效的编码)不要将 BOM 放入 UTF-8 结果中?
实验表明,指示UTF-16而不是UTF-16BE做你想要的:
UTF-16
UTF-16BE
iconv -f UTF-16 -t UTF-8 myfile.txt