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

佐手、 提交于 2019-12-05 01:19:46
WhozCraig

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).

If in doubt take a look at the hex. Here the start of notepad.exe's rc file, in UTF16:

0002ed60  01 00 53 00 74 00 72 00  69 00 6e 00 67 00 46 00  |..S.t.r.i.n.g.F.|
0002ed70  69 00 6c 00 65 00 49 00  6e 00 66 00 6f 00 00 00  |i.l.e.I.n.f.o...|
0002ed80  a6 02 00 00 01 00 30 00  34 00 30 00 39 00 30 00  |......0.4.0.9.0.|
0002ed90  34 00 42 00 30 00 00 00  4c 00 16 00 01 00 43 00  |4.B.0...L.....C.|
0002eda0  6f 00 6d 00 70 00 61 00  6e 00 79 00 4e 00 61 00  |o.m.p.a.n.y.N.a.|
0002edb0  6d 00 65 00 00 00 00 00  4d 00 69 00 63 00 72 00  |m.e.....M.i.c.r.|
0002edc0  6f 00 73 00 6f 00 66 00  74 00 20 00 43 00 6f 00  |o.s.o.f.t. .C.o.|
0002edd0  72 00 70 00 6f 00 72 00  61 00 74 00 69 00 6f 00  |r.p.o.r.a.t.i.o.|
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!