4D v16.3

ASCII Codes

Home

 
4D v16.3
ASCII Codes

ASCII Codes  


 

 

Compatibility Note: 4D can function with two character sets: Unicode or ASCII. The Unicode mode is the standard mode since version 11 of 4D. The ASCII mode is kept for compatibility reasons in databases created with an earlier version of 4D. This mode is called ASCII compatibility mode.

It is possible to apply the Unicode mode to converted databases via the Unicode Mode selector of the Get database parameter and SET DATABASE PARAMETER commands or via the Unicode Mode option found on the Compatibility page of the Database Settings:

In most cases, the initial functioning of applications is not affected by this setting, since 4D handles any necessary character conversions internally. Moreoever, the most common characters (a-z, 0-9, and so on) have the same value (from1 to 127) in both Unicode and ASCII (Windows and Mac OS).

However, certain language statements, more particularly those using commands that work with character strings, may require some adaptation. For example, the statement Char(200) will not return the same value in Unicode as in ASCII. This manual describes the differences in functioning between the Unicode mode and the ASCII compatibility mode for each command concerned.

Note: This mode is specific to each database. It is therefore possible to have a Unicode database coexisting with non-Unicode components (or vice versa).

When the database is operating in ASCII compatibility mode, on both Macintosh and Windows, the internal database engine and the 4D language work with the Macintosh extended ASCII set. When you enter data using the keyboard (adding records, editing procedures, etc.), 4D uses the internal Altura ASCII conversion scheme to convert what comes from the keyboard (expressed using the Windows set) to the Macintosh set. For example, to enter an “é”, you type ALT+0233, and 4D stores ASCII code 142 in the record. This is transparent to the end user, because when you create a search, you actually type (in the Search editor) the value for which you are looking. Therefore, the value that you typed (ALT+0233) is also translated into ASCII code 142, and you find the value.

The codes work the same when you type ALT+0233 in the Procedure editor. However, to look for a character using its ASCII code, you use the Macintosh ASCII code of the character.

For example:

 QUERY(...;[MyFile]MyField="é") ` é is Alt+0233

is the same as:

 QUERY(...;[MyFile]MyField=Char(142)) ` é is ASCII 142

  • The standard ASCII codes, 0 through 127, are common to Windows and Macintosh.
  • The ASCII codes 128 through 255 are different on Windows and Macintosh. In order to maintain platform independence, the Windows version of 4D automatically converts ASCII codes from Windows to Macintosh ASCII maps when characters are entering the 4D environment (Data entry, Edit/Paste, Import, etc.) and from Macintosh to Windows ASCII maps when characters are leaving the 4D environment (Edit/Cut or Copy, Export, etc.).
ASCII Codes 0 to 63


ASCII Codes 64 to 127


ASCII Codes 128 to 191

ASCII Codes 192 to 255

Note: The grayed out boxes indicate characters that are not available under Windows, or different from Macintosh characters.



See also 

_o_ISO to Mac
_o_Mac to ISO
_o_Mac to Win
_o_Win to Mac
Character code
ON EVENT CALL

 
PROPERTIES 

Product: 4D
Theme: Character Codes

 
HISTORY 

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)