Resource compilation error (Bad character in source input)

99封情书 提交于 2019-12-25 02:37:12

问题


I have added text file with following content to the project:

1 24 "MyApplication.manifest"

In the same folder there is also MyApplication.manifest file which is XML - this one: C++ Builder / Delphi 2010 application manifest template

After I attempt to build resource from RC I get error - Bad character in source input(1)

Any ideas why?

RT_MANIFEST value is 24, but I am unsure what 1 is supposed to be.


回答1:


I managed to find the answer myself so no answer necessary. The problem was, as usual very obscure.

Turned out that the resource script file (.RC) I was using had an UTF-8 byte order mark in the file (0xEF,0xBB,0xBF) which was invisible to the text editor but resource compiler complained about it. After removing the BOM resource compiled correctly.

I don't think many people fall into this trap but at least if anyone else sees this error in resource compiler, you should examine if there is an UTF-8 BOM in your file by viewing HEX-dump of RC file because brcc32.exe resource compiler seems to have issues with that.



来源:https://stackoverflow.com/questions/25538863/resource-compilation-error-bad-character-in-source-input

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!