Unit 'charset' Package
[Overview][Constants][Types][Procedures and functions][Index] [#rtl]

getascii

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

Declaration

Source position: charset.pp line 89

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: Dec 24 2024