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

Returns the number of bytes generated by encoding Chars.

Pascal
function GetByteCount(Chars: PChar; CharCount: Integer): Integer; virtual; abstract; overload;
function GetByteCount(const Chars: TCharArray): Integer; overload;
function GetByteCount(const Chars: TCharArray; CharIndex: Integer; CharCount: Integer): Integer; overload;
function GetByteCount(const S: string): Integer; overload;
function GetByteCount(const S: string; CharIndex: Integer; CharCount: Integer): Integer; overload;
C++
virtual __fastcall int GetByteCount(const char * Chars, int CharCount) = 0;
__fastcall int GetByteCount(const TCharArray Chars);
__fastcall int GetByteCount(const TCharArray Chars, int CharIndex, int CharCount);
__fastcall int GetByteCount(const AnsiString S);
__fastcall int GetByteCount(const AnsiString S, int CharIndex, int CharCount);

Returns the number of bytes generated by encoding Chars. Note that the number of bytes in a string is not necessarily exactly proportional to the number of characters in a given character array or string.  

The Chars parameter can be a character array or a character pointer containing the bytes to be counted. 

The S parameter refers to a UnicodeString from which the Byte count will be extracted. 

The CharCount parameter specifies the number of characters to encode. 

The CharIndex parameter indicates the index within the Chars array where counting should begin. 

The CharCount parameter indicates the number of characters that should be included when counting the bytes. 

The Return Value is the number of bytes in the passed Chars or S parameter. 

 

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