System.SysUtils.TUnicodeEncoding.GetByteCount
Delphi
function GetByteCount(Chars: PChar; CharCount: Integer): Integer; overload; override;
C++
virtual int __fastcall GetByteCount(System::WideChar * Chars, int CharCount)/* overload */;
inline int __fastcall GetByteCount(const System::WideChar Chars){ return TEncoding::GetByteCount(Chars); }
inline int __fastcall GetByteCount(const System::WideChar *Chars, const int Chars_High){ return TEncoding::GetByteCount(Chars, Chars_High); }
inline int __fastcall GetByteCount(const System::DynamicArray<System::WideChar> Chars){ return TEncoding::GetByteCount(Chars); }
inline int __fastcall GetByteCount(const System::WideChar *Chars, const int Chars_High, int CharIndex, int CharCount){ return TEncoding::GetByteCount(Chars, Chars_High, CharIndex, CharCount); }
inline int __fastcall GetByteCount(const System::DynamicArray<System::WideChar> Chars, int CharIndex, int CharCount){ return TEncoding::GetByteCount(Chars, CharIndex, CharCount); }
inline int __fastcall GetByteCount(const System::UnicodeString S){ return TEncoding::GetByteCount(S); }
inline int __fastcall GetByteCount(const System::UnicodeString S, int CharIndex, int CharCount){ return TEncoding::GetByteCount(S, CharIndex, CharCount); }
inline int __fastcall GetByteCount(const System::UnicodeString S, int CharIndex, int CharCount, const int StringBaseIndex){ return TEncoding::GetByteCount(S, CharIndex, CharCount, StringBaseIndex); }
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | class protected public |
System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | TUnicodeEncoding |
Description
Returns the number of bytes generated by encoding the passed characters.
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. A character in UTF-16 encoded strings is 2 bytes wide.
The following table lists the parameters expected by this method and their description.
Parameter | Description |
---|---|
Chars |
A character array or a character pointer containing the bytes to be counted. |
CharCount |
Specifies the number of characters to encode. |
The return value is the number of bytes in the passed Chars parameter.