Skip to content

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;

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

Name Description
getunicode Map single-byte character to Unicode character.