TEncoding.GetString

Return a string based on an array of bytes

Declaration

Source position: sysencodingh.inc line 89

public 
  function GetString(const Bytes: TBytes) : UnicodeString;  Overload;
  function GetString(const Bytes: TBytes; ByteIndex: Integer; 
                    ByteCount: Integer) : UnicodeString;  Overload;

Description

GetString will return a Unicode string, created from the bytes in the Bytes array. The bytes array will be interpreted according to the encoding which the TEncoding represents.

If ByteIndex and ByteCount are specified, only the ByteCount bytes starting at position ByteIndex will be converted.

Errors

In case of invalid bytes, an EEncodingError exception may be raised.