Indicates whether a byte in a string is a single byte character, the first byte of a double byte character, or the second byte of a double byte character.
function ByteType(const S: string; Index: Integer): TMbcsByteType;
TMbcsByteType ByteType(const AnsiString S, int Index);
SysUtils
Call ByteType to determine whether a specified byte in a string is a single-byte character, the first byte of a multibyte character, or one of the trailing bytes.
AnsiString is the string that contains the byte in question.
Index identifies the byte for which you want to know the byte type. Bytes are numbered from 1.
If the system is not using a multi-byte character system (MBCS), ByteType always returns mbSingleByte. Otherwise, ByteType returns mbSingleByte if the indicated byte represents a complete character in S, mbLeadByte if it represents the first byte of a double byte character, and mbTrailByte if it represents a subsequent byte of a multibyte character.
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
|
What do you think about this topic? Send feedback!
|