xHarbour Reference Documentation > Function Reference |
Converts a character string from the ANSI to the OEM character set.
HB_AnsiToOem( <cANSI_String> ) --> cOEM_String
The function returns a string converted to the OEM character set.
The function converts all characters of <cANSI_String> to the corresponding characters in the MS-DOS (OEM) character set. Both character sets differ in characters whose ASCII values are larger than 127.
If a character in the ANSI string does not have an equivalent in the OEM character set, it is converted to a similar character of the OEM character set. In this case, it may not be possible to reverse the ANSI => OEM conversion with function HB_OemToAnsi().
Note: all databases created with Clipper store their data using the OEM character set. Displaying data in xHarbour console applications occurs with the OEM character set. Data display in xHarbour GUI applications is done with the Windows ANSI character set.
See also: | HB_OemToAnsi(), HB_SetCodePage() |
Category: | Conversion functions , xHarbour extensions |
Source: | rtl\oemansi.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates the effect of ANSI<->OEM conversion // using a character string where the conversion is not reversible. // The character string contains characters used for line graphics // in DOS. #include "Box.ch" PROCEDURE Main LOCAL cOEM1 := B_SINGLE LOCAL cANSI := HB_OemToAnsi( B_SINGLE ) LOCAL cOEM2 := HB_ANsiToOem( cANSI ) DispBox(10, 10, 20, 20, cOEM1 ) @ Row(), COl() SAY "OEM1" DispBox(10, 30, 20, 40, cANSI ) @ Row(), COl() SAY "ANSI" DispBox(10, 50, 20, 60, cOEM2 ) @ Row(), COl() SAY "OEM2" @ MaxROw()-1, 0 WAIT RETURN
http://www.xHarbour.com