RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TEncoding.GetChars Method (PByte, Integer, PChar, Integer)

Decodes a set of bytes into a set of characters.

Pascal
function GetChars(Bytes: PByte; ByteCount: Integer; Chars: PChar; CharCount: Integer): Integer; virtual; abstract; overload;
function GetChars(const Bytes: TBytes): TCharArray; overload;
function GetChars(const Bytes: TBytes; ByteIndex: Integer; ByteCount: Integer): TCharArray; overload;
function GetChars(const Bytes: TBytes; ByteIndex: Integer; ByteCount: Integer; var Chars: TCharArray; CharIndex: Integer): Integer; overload;
C++
virtual __fastcall int GetChars(PByte Bytes, int ByteCount, const char * Chars, int CharCount) = 0;
__fastcall TCharArray GetChars(const TBytes Bytes);
__fastcall TCharArray GetChars(const TBytes Bytes, int ByteIndex, int ByteCount);
__fastcall int GetChars(const TBytes Bytes, int ByteIndex, int ByteCount, TCharArray Chars, int CharIndex);

TEncoding.GetChars generates a number of characters by decoding Bytes.  

Bytes can be a byte pointer or a byte array. 

ByteIndex specifies the first byte to decode. If not present, the index is 0. 

ByteCount specifies the number of bytes to decode. If not present, all bytes will be decoded. 

Chars is a pointer to the destination of the decoded characters.  

CharIndex specifies the maximum number of characters to store.  

The Return Value is either a character array of the decoded characters, or the number of characters decoded. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!