Sign in Join
FPDoc Onlineexperiment

getascii function

In unit charset

Convert Unicode character or string to single-byte character or string.

Declaration

pascal
function getascii(c: tunicodechar; p: punicodemap): string

Arguments

c

Character to translate.

p

Mapping to use.

Function result

Translated character as string, or number of characters copied to buffer.

Description

getascii converts a Unicode character c to one or more single-byte characters according to the map in p. The result can be a string containing up to 2 characters, or the number of characters copied to the buffer ABuffer with length ABufferLen.

Errors

If the character cannot be translated, ASCII character 63 is returned (or copied to the buffer). In the case of the buffer variant of the function, -1 is then returned. If the buffer is not large enough, -1 is returned.

See also

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