Working with Code Pages in Windows
Applications designed on Win32, depending on the development
language or IDE, use either UNICODE or ANSI. ANSI applications,
like programs designed with Delphi and C++ Builder, use code page
encoded strings and a non-Unicode version of WIN32 API. Why do
you have to know this information?
There are several different code pages. English and most other
Western languages use code page 1252. Japanese uses 932, Russian
uses 1251, and so forth. To render an ANSI string correctly, the
application must have the right system code page. This page is
the default code page of the system. In Windows ME, 98, and 95
you cannot change the system code page.
However, in Windows 2003, XP, 2000, and NT, you can change the
system code page. This document describes how to check if the
system code page is right, and, if it isn't, how to change it.
How do I know if the system code page
is not right?
Usually, you will see the problem when trying to run your application.
If strings in the menu items and components do not show correctly
and display gibberish, the system code page is not right. The
following screenshot shows a Japanese application that is run
on a computer where the Japanese system code page is active.
Everything is fine here. However, if the same application is
running on a computer that has the Western code page, the application
appears like this:
As you can see, hopefully without the help of your Japanese colleagues,
the strings are gibberish.
Practical Hint:
Use virtual machines for different code pages
The following information describes how you can learn how
to change the system code page. This is simple; however,
Windows asks you to reboot your machine every time. This
is time-consuming and might interrupt your work.
A solution to this is to use a virtual machine,
such as Virtual PC or VMWare. Set up multiple virtual PCs
with different code pages for the languages you want to
support and test without rebooting. While the market even
offers free editions all you need is some free
space on your hard drive to follow this practical hint.
|
How do I change the system code page?
You can change the system code page using the Control Panel.
The following instructions are for English Windows XP. The procedure
is similar for Windows 2000.
Start the Control Panel, and open Regional and Language
Options. On the Regional Options tab, specify information
in the Standards and formats box and in the Location
box to match the target language and country.
On the Advanced tab, specify settings in the Language
for non-Unicode programs boxes to match the target language.
Click OK. You might need to insert the operating system
CD to install the necessary files. If you already have the files
installed, the system prompts you to use the existing files. Click
Yes. Next, the system prompts you to restart the computer.
Click Yes. You must reboot. Otherwise, the new system code
page won't be effective.
Asian languages
If you are using Asian languages, such as Chinese, Korean, Japanese
or Thai, select the options in the Supplemental language support
area on the Languages tab.
There are two written Chinese formats: Simplified and Traditional.
Be careful to choose the right one: Use Chinese (PRC) and China
for Simplified Chinese, and Chinese (Taiwan) and Taiwan for Traditional
Chinese.
|