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

getunicode

Map single-byte character to unicode character.

Declaration

Source position: charset.pp line 80

function getunicode(

  c: Char;

  p: punicodemap

):tunicodechar;

function getunicode(

  AAnsiStr: pansichar;

  AAnsiLen: LongInt;

  AMap: punicodemap;

  ADest: tunicodestring

):LongInt;

Arguments

c

  

Character to translate

p

  

Single-byte to Unicode character map to use.

Function result

Unicode character or number of unicode characters in translated string.

Arguments

AAnsiStr

  

Ansi string to tranform.

AAnsiLen

  

Length (in bytes) of ansi string to tranform

AMap

  

Single-byte to Unicode character map to use.

ADest

  

Buffer for translated unicode string.

Description

The first form of getunicode will map a single character c to its unicode equivalent for mapping p. If no equivalent can be found, 0 is returned.

The second form of getunicode will transform a string (specified using a pointer AAnsiStr to a buffer with length AAnsiLen) to a unicode string using single byte codepage map AMap. It returns the number of unicode characters. If ADest is Nil then just the number of characters is returned. If ADest is not nil, it must point to a buffer large enough to contain the unicode string, and the converted string will be copied to it.

Errors

No checking on the validity of the buffers is done.

See also

getascii

  

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


Documentation generated on: Nov 14 2015