I\'m having trouble with Unicode characters being displayed incorrectly on my UI. I have a resource-only DLL containing a string table used for UI localization. I create t
I found a reference from 2002 indicating that you need to tell the resource compiler how the .rc file is encoded. For UTF-8, that's code page 65001, so you'd run this:
brcc32 -c65001 lang.rc
Then, of course, you'd remove the 'lang.rc'
part from the $R
directive in your code because you no longer want the IDE to invoke the resource compiler itself.
If your Delphi version is recent enough, then you can keep the full $R
directive and instead set the -c65001
option in the resource-compiler configuration of your project options.
It's hard to know the encoding of a file just by looking at it. There can be many valid guesses. The -c
option is documented, but the documentation doesn't mention when you'd need to use it, or what the IDE uses when it runs the resource compiler. The IDE probably just uses the default, the same as brcc32.exe, which is the system's default ANSI code page.