We help IT Professionals succeed at work.

editing unicode resources

cternoey
cternoey asked
on
I am very eager to internationalize my application.

I studied the paper and code by F. Avery Bishop...
http://www.microsoft.com/msj/0499/multilangUnicode/multilangunicode.htm
and found that very interesting.

However, when I try to edit the resource scripts (e.g. the japanese script is res411.rc), I am not able to open them. (I can edit the German, one of course.)

How did Bishop edit and compile all of those resource scripts? How can I?

(My main machine has VC5 on Win2000. My second machine has VC6 and win98.)

Thanks
-c
Comment
Watch Question

CERTIFIED EXPERT
Author of the Year 2009

Commented:
Did you try what was suggested in the article?

"...go to the Regional Options control panel applet and install the missing language groups."

-- Dan
IF your resource scripts are actually unicode then Visual Studio will not be able to open them for editing.  It will be able to compile them, though.  To edit unicode resource files (which are primarily just text anyway), you can use Notepad.  Notepad's pretty basic but it does save and load files in either ANSI or unicode.  If you are on a Windows 2000 system you can pretty much handle all of the Latin languages without a problem.  For "other" languages such as Japanese, you will probably have to install the correct language/font.  For Windows 2000, look at "Regional Options" in the Control Panel.

Author

Commented:
Apparently I had done everything correct:
1) create a resource script in VC
2) edit resource script in notepad to add Japanese
   (and save as Unicode text)
3) switch compiler settings to unicode
4) recompile

I had even adjusted regional options as the article suggested, but i was too dumb to realize that i needed to make sure that the font setting of my dialog resource was a japanese-aware font.

Thank you for your suggestions, though.
Both were smart and thoughtful.

Would you mind addressing a follow-up question?

How can I make this work as a MBCS app?
Leaving out step 3 really screws everything up,
but i do not know why. I guess the problem is
that Notepad can only save in unicode format, not mbcs.
So how does one add japanese to a resource script for
an mbcs project?

Thanks!
-c
It depends on just what you're doing.  Notepad can save in ASCII or unicode format -- but don't expect it to actually convert correctly.  If you don't want to use unicode then you can fall back on the NLS functions and convert from unicode to ASCII using the appropriate code page for display.  In some cases that's the only option, e.g., if you are using almost any Visual Basic control.  As for saving the Japanese resource script, you would have to do the same.  Convert the unicode strings to MBCS using the Japanese code page and save the converted strings.  Not sure of any tools out theree to do that, though.  Have you looked at Microsoft's tools for generating resource files for multiple languages from a single resource file?  They're a bit simplistic but might help.

Author

Commented:
Great tips. Thanks!
-c

Explore More ContentExplore courses, solutions, and other research materials related to this topic.