How to compile a UTF-8 resource file

  • Thread starter Thread starter Zheng Huang
  • Start date Start date
Z

Zheng Huang

Hello, All.

I have a UTF-8 resource file which contrains all the
translatable strings. when I compile it, I will get "RC :
fatal error RC1205 : invalid code page". Here is the
command I used:

rc /x /v /cUTF-8 testResource.rc

Can someone tell me what is the valid code page for "UTF-
8" or point me to the right place where I can look it up
myself?

Thanks very much,
Zheng Huang
 
I have a UTF-8 resource file which contrains all the
translatable strings. when I compile it, I will get "RC :
fatal error RC1205 : invalid code page". Here is the
command I used:

rc /x /v /cUTF-8 testResource.rc

The resource compiler does not support UTF8.
It does support UTF16 with BOM though.
Without parameters, it will detect the BOM (byte oder mark).

Mihai
 
Thanks, Mihai, for your tips.

When I use the compiled resoure file (UTF-16), VB still
does not display the Swedish character correctly. I have a
character ä in the resource file. When I use "MsgBox
(LoadResString(100)), it displays ä .
Can you tell me what I am missing?

Thanks in advance,
Zheng
 
ä encoded as UTF8 is ä
It looks like you RC file is UTF8, then you compile it as ANSI.

Make sure you save it as UTF16
(from Notepad select "Save as..." and chose Unicode as file type)
Then compile using
/l 0x41d (to indicate Swedish)
No need to use /c, the BOM added by Notepad will do the trick

Another option, if you want Swedish, is to use the 1252 encoding,
the ANSI one for Swedish.
(from Notepad select "Save as..." and chose Text as file type)
Then compile it using
/c 1252 (to indicate the code page)
and
/l 0x41d (to indicate Swedish)

Mihai
 
Back
Top