Consultor Eletrônico



Kbase 20846: I18N. How to Call WIN32 API Function GetACP?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   12/17/2004
Status: Unverified

GOAL:

I18N. Sample code to call the Win32 API function "GetACP". The GetACP function retrieves the current ANSI code-page identifier for the system.

GOAL:

How to Call WIN32 API Function GetACP?

FACT(s) (Environment):

Win32 API
Windows NT4

SYMPTOM(s):

Windows Code-Page

CAUSE:

ANSII code page identifiers are:
Identifier Meaning
874 Thai
932 Japan
936 Chinese (PRC, Singapore)
949 Korean
950 Chinese (Taiwan, Hong Kong)
1200 Unicode (BMP of ISO 10646)
1250 Windows 3.1 Eastern European
1251 Windows 3.1 Cyrillic
1252 Windows 3.1 Latin 1 (US, Western Europe)
1253 Windows 3.1 Greek
1254 Windows 3.1 Turkish
1255 Hebrew
1256 Arabic
1257 Baltic

FIX:

The following sample code has been tested on Windows NT4:
/* Variable Declaration */
DEFINE VARIABLE iCodePage AS INTEGER NO-UNDO.

/* Definition */
PROCEDURE GetACP EXTERNAL "kernel32":
DEFINE RETURN PARAMETER iCodePage AS LONG .
END PROCEDURE.

RUN GetACP(OUTPUT iCodePage).

/* Display the current code-page */
MESSAGE iCodePage VIEW-AS ALERT-BOX.