[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'charset' (#rtl)

getascii

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

Declaration

Source position: charset.pp line 87

function getascii(

  c: tunicodechar;

  p: punicodemap

):string;

function getascii(

  c: tunicodechar;

  p: punicodemap;

  ABuffer: PAnsiChar;

  ABufferLen: LongInt

):LongInt;

Arguments

c

  

Character to translate.

p

  

Mapping to use

Function result

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

Arguments

c

  

Character to translate.

p

  

Mapping to use

ABuffer

  

Buffer to copy characters to.

ABufferLen

  

Length of buffer ABuffer

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

getunicode

  

Map single-byte character to unicode character.


Documentation generated on: Sep 28 2017