Search code examples
c++winapidllresourcesrc

Are resource files compiled as UNICODE or ANSI code-page?


First - my apologies if this has been answered a hundred times over! D'oh!

But my search-fu apparently sucks, as I'm having no luck answering this basic question:

How are resources stored in the EXE/DLL? As UNICODE (UCS-2, Windows native internal character format), or as multibyte characters using the code-page of the resources block?

  • How does one embed UNICODE strings into one's resources (.rc)?
  • Can UNICODE (UCS-2) text be inserted into the language strings from within VS 2012?
  • Is Windows still using UCS-2, or is it using UTF16 internally?

I'm just looking for general answers, or links to details, rather than a detailed how-to for putting a UNICODE string into an .rc string table. Thanks!


Solution

  • All resource strings in WIN32 are compiled as Unicode. See here for more info. The .rc script itself can be ANSI (using the local codepage) or UCS-2 with the appropriate BOM (reference).