可能是在记事本(或其他编辑器)中打开了文件。字节序列0xEFBEF是UTF8中所谓的“字节顺序标记”,UTF8文件需要它来标记字节顺序(EndiaNess)。实际上是它的0xFFEF,但是在UTF8中它被重新编码。由于从PSoC3到5的切换改变了编译器(Keil对GCC),它也改变了字符编码的处理。对于UTF8,BOM是不需要的。
您可以尝试打开CyPress创建者中的文件,删除第一行,然后手动重新键入。这应该删除BOM。以后,尽量避免文件中的任何ULLUTT,这可能会导致编辑器切换到Unicode编码。避免记事本:
以上来自于百度翻译
以下为原文
Probably you opened the file in Notepad (or some other editor). The byte sequence 0xefbbef is the so-called "byte order mark" in UTF8, which is needed for UTF16 file to mark the byte order (endianness). Actually its 0xfeff, but in UTF8 it gets re-encoded. Since switching from PSoC3 to 5 changes the compiler (Keil vs. gcc), it also changes the handling of character encoding. For UTF8 the BOM is not needed.
You can try to open the file in Cypress Creator, delete the first line and then re-type it manually. That should remove the BOM. In the future, try to avoid any umlauts in your file, which might cause the editor to switcxh to a Unicode-encoding. And avoid notepad :)
可能是在记事本(或其他编辑器)中打开了文件。字节序列0xEFBEF是UTF8中所谓的“字节顺序标记”,UTF8文件需要它来标记字节顺序(EndiaNess)。实际上是它的0xFFEF,但是在UTF8中它被重新编码。由于从PSoC3到5的切换改变了编译器(Keil对GCC),它也改变了字符编码的处理。对于UTF8,BOM是不需要的。
您可以尝试打开CyPress创建者中的文件,删除第一行,然后手动重新键入。这应该删除BOM。以后,尽量避免文件中的任何ULLUTT,这可能会导致编辑器切换到Unicode编码。避免记事本:
以上来自于百度翻译
以下为原文
Probably you opened the file in Notepad (or some other editor). The byte sequence 0xefbbef is the so-called "byte order mark" in UTF8, which is needed for UTF16 file to mark the byte order (endianness). Actually its 0xfeff, but in UTF8 it gets re-encoded. Since switching from PSoC3 to 5 changes the compiler (Keil vs. gcc), it also changes the handling of character encoding. For UTF8 the BOM is not needed.
You can try to open the file in Cypress Creator, delete the first line and then re-type it manually. That should remove the BOM. In the future, try to avoid any umlauts in your file, which might cause the editor to switcxh to a Unicode-encoding. And avoid notepad :)
举报