Returns a character string that is the ANSI equivalent of a character expression using the current global character set.

Syntax

ANSI(<expC>)

<expC>

The character expression to convert to ANSI characters.

Description

Each character in a string is represented by a byte value from 0 to 255. The character each number represents is determined by the current character set. The same series of bytes may represent different characters with different character sets. Conversely, the same character may be represented by a different byte value in different character sets.

Windows uses the ANSI (American National Standards Institute) character set. dBASE Plus supports that character set, and multiple OEM (Original Equipment Manufacturer) character sets, which are identified by a code page number. (For more information, see About character sets.) Each character set, along with other country-specific information, is represented in dBASE Plus by a language driver. The classic IBM extended character set—the one with box drawing characters used in text screens and the MS-DOS Command Prompt—is an OEM character set, represented by the DB437US0 language driver, the default language driver for the United States.

There are more characters in use than will fit in a 256-character character set; therefore some characters are present in some character sets but not in others. While the lower 128 characters of these character sets are always identical (they match the standard 7-bit ASCII characters), the upper 128 characters (sometimes referred to as high-ASCII characters) may differ. Sometimes the same characters have different byte values. For example, the lowercase a-umlaut (ä) is character 132 in the DB437US0 OEM character set, and character 228 in the ANSI character set.

Use the ANSI( ) and OEM( ) functions to convert characters between the ANSI character set and an OEM character set, represented by the current global language driver.

Note

If the current language driver is an ANSI language driver, like DBWINUS0, then DB437US0 is used as the OEM character set.

ANSI( ) treats the byte values of the characters in <expC> as OEM characters, and attempts to convert them to the equivalent characters in the ANSI character set. OEM( ) does the reverse. If no direct conversion is possible, then the characters are converted to similar-looking characters.