Showing posts with label Internationalization. Show all posts
Showing posts with label Internationalization. Show all posts

Sunday, June 5, 2022

Supporting Chinese, Japanese and Korean (CJK) languages in MBCS C++ Applications

There are plenty of  MBCS based legacy MFC applications out there that require CJK language support. Migrating to Unicode is not an option in these cases.

All the resources such as menus, dialogs, string tables used by the application are defined in the .rc file. 
However this rc file will not be a part of  the application. It will be part of  separate resource only DLL known as satellite Dll, There will be one satellite Dll for each  language supported by the application.  The main application just loads the satellite dlls for the current code page and avails the resources such as  menus, dialogs, string tables.

Steps for setting language
1. For MBCS applications, the correct code page i.e,  Japanese, chinese traditional or simplified, should be first set in the control panel.as shown below. The system should be restarted.

2.The .RC file must be encoded in the correct format as shown in the table below:
Japanese                        ShiftJIS
Chinese Traditional       Big5
Chinese Simplified        GB312

3. Language specific changes should be made in the RC file. An example for Japanese is shown below.

4. Use Unicode Win32 APIs for rendering.
Sometimes some special characters such as subscript and superscript  are not rendered correctly as they are not available in the codepage. In such cases Unicode Win32  apis can be used in the subclassed controls such as radio buttons.

Source and Binaries can be found here.