This function translates a string from one code page to another.
#define INCL_WINCOUNTRY /* Or use INCL_WIN, INCL_PM, */ #include <os2.h> HAB hab; /* Anchor-block handle. */ ULONG idCpSource; /* Source-string code page. */ PSZ pszSource; /* String to be translated. */ ULONG idCpDest; /* Code page of the resultant string. */ ULONG cbLenDest; /* Maximum length of output string. */ PSZ pszDest; /* The translated string. */ BOOL rc; /* Success indicator. */ rc = WinCpTranslateString(hab, idCpSource, pszSource, idCpDest, cbLenDest, pszDest);