RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TUnicodeEncoding.GetBytes Method

Encodes a set of characters into a sequence of bytes.

Pascal
function GetBytes(Chars: PChar; CharCount: Integer; Bytes: PByte; ByteCount: Integer): Integer; override; overload;
C++
virtual __fastcall int GetBytes(const char * Chars, int CharCount, PByte Bytes, int ByteCount);

TEncoding.GetBytes encodes Chars parameter into a sequence of bytes. 

Chars can be a character array or a character pointer which will be encoded into a sequence of bytes. 

S is a string of type UnicodeString to be encoded into a sequence of bytes. 

The CharCount parameter specifies the number of characters to encode. 

Bytes specifies the location to write the sequence of bytes. 

ByteCount is the maximum number of bytes that can be written to the given location. 

The Return Value is the number of bytes actually encoded or the actual TBytes sequence of bytes. 

 

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