This example translates a string from US code page 437 to multilingual code page 850.

#define INCL_WINCOUNTRY         /* Window Country Functions     */
#include <os2.h>

HAB     hab;            /* anchor-block handle                  */
ULONG   idCpSource=437; /* Code page of source character (US)   */
ULONG   idCpDest=850;   /* Code page of dest. character (multi) */
char    pszSource[10];  /* source string                        */
char    pszDest[10];    /* destination string                   */
ULONG   cbLenDest = 9L; /* max length of destination string     */
BOOL    fSuccess;
strcpy(pszSource,"TRANSLATE");
fSuccess = WinCpTranslateString(hab, idCpSource, pszSource,
                                idCpDest, cbLenDest, pszDest);


[Back] [Next]