Function ConvToOemCP() Foundation

Converts a character string to an OEM code page

Syntax
ConvToOemCP( <cAnsiFormatString> ) --> cOemFormatString
Parameters
<cAnsiFormatString>
<cAnsiFormatString> is a character string containing characters from an ANSI character set.
Return

The function returns a string converted to OEM.

Description

The function ConvToOemCP() converts character strings from ANSI to OEM. ANSI and OEM character sets differ especially in language specific special characters, like the German umlauts, for example.

Normally, a string conversion is not necessary since Xbase++ performs a conversion automatically. However, if data is imported from other Windows programs into an Xbase++ application, an explicit conversion to OEM may be necessary.

This function works independent of the character set selected with the SET CHARSET command.

Examples
Converting character strings to OEM

// All German umlauts are coded in this example as ANSI and OEM 
// strings. The ANSI string is converted to OEM. The output of the 
// program is redirected to a file which can be viewed in an ANSI 
// and OEM editor for better demonstration. 

PROCEDURE Main 
   LOCAL cOem, cAnsi 

   cOem  := Chr(142)+Chr(132)+Chr(153)+Chr(148)+Chr(154)+Chr(129) 
   cAnsi := Chr(196)+Chr(228)+Chr(214)+Chr(246)+Chr(220)+Chr(252) 

   SET ALTERNATE TO Ansi_Oem.txt 
   SET ALTERNATE ON 

   ? "OEM       " , cOem 
   ? "ANSI      " , cAnsi 
   ? 
   ? "CONV ANSI " , ConvToOemCP( cAnsi ) 

   SET ALTERNATE TO 
   SET ALTERNATE OFF 

RETURN 
Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.