Sign in Join
FPDoc Onlineexperiment

TDBEdit.UTF8KeyPress procedure

Member of TDBEditprotectedIn unit DBCtrls

Handles UTF-8 characters for the data-aware control.

Declaration

pascal
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override

Arguments

UTF8Key

UTF-8 character examined in the method.

Description

UTF8KeyPress is an overridden method in TDBEdit. UTF8KeyPress calls the inherited method, and performs actions needed to handle the UTF-8-encoded character specified in the UTF8Key argument.

UTF8KeyPress checks the value in UTF8Key to determine the number of bytes required for the code point. A single-byte code point is converted to a Char type, and passed to the FieldCanAcceptKey routine to validate its content for the Field in the control. Multi-byte Unicode code points are ignored, and the Extended ASCII NbSp character (Decimal 255) is passed to FieldCanAcceptKey. The value in UTF8Key is set to an empty string if it is valid for the Field.

Use the OnUTF8KeyPress event handler to handle/convert specific multi-byte character values.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.