139 |
|
function GetModified: boolean; virtual; |
140 |
|
function GetDateTimeStrLength(DateTimeFormat: TIBDateTimeFormats): integer; |
141 |
|
function GetSize: cardinal; virtual; abstract; |
142 |
+ |
function GetCharSetWidth: integer; virtual; abstract; |
143 |
|
procedure SetAsBoolean(AValue: boolean); virtual; |
144 |
|
procedure SetAsCurrency(Value: Currency); virtual; |
145 |
|
procedure SetAsInt64(Value: Int64); virtual; |
242 |
|
function GetRelationName: AnsiString; virtual; abstract; |
243 |
|
function GetScale: integer; virtual; abstract; |
244 |
|
function GetCharSetID: cardinal; virtual; abstract; |
245 |
+ |
function GetCharSetWidth: integer; virtual; abstract; |
246 |
|
function GetCodePage: TSystemCodePage; virtual; abstract; |
247 |
|
function GetIsNull: Boolean; virtual; abstract; |
248 |
|
function GetIsNullable: boolean; virtual; abstract; |
322 |
|
function getCharSetID: cardinal; override; |
323 |
|
function GetIsNullable: boolean; override; |
324 |
|
function GetSize: cardinal; override; |
325 |
+ |
function GetCharSetWidth: integer; override; |
326 |
|
function GetArrayMetaData: IArrayMetaData; |
327 |
|
function GetBlobMetaData: IBlobMetaData; |
328 |
|
function GetStatement: IStatement; |
1181 |
|
{Copied from LazUTF8} |
1182 |
|
|
1183 |
|
function UTF8CodepointSizeFull(p: PAnsiChar): integer; |
1184 |
< |
const TopBitSetMask = $8000; {%10000000} |
1185 |
< |
Top2BitsSetMask = $C000; {%11000000} |
1186 |
< |
Top3BitsSetMask = $E000; {%11100000} |
1187 |
< |
Top4BitsSetMask = $F000; {%11110000} |
1188 |
< |
Top5BitsSetMask = $F800; {%11111000} |
1184 |
> |
const TopBitSetMask = $80; {%10000000} |
1185 |
> |
Top2BitsSetMask = $C0; {%11000000} |
1186 |
> |
Top3BitsSetMask = $E0; {%11100000} |
1187 |
> |
Top4BitsSetMask = $F0; {%11110000} |
1188 |
> |
Top5BitsSetMask = $F8; {%11111000} |
1189 |
|
begin |
1190 |
|
case p^ of |
1191 |
|
#0..#191: // %11000000 |
1228 |
|
function GetStrLen(p: PAnsiChar; CharWidth, MaxDataLength: cardinal): integer; |
1229 |
|
var i: integer; |
1230 |
|
cplen: integer; |
1231 |
+ |
s: AnsiString; |
1232 |
|
begin |
1233 |
|
Result := 0; |
1234 |
+ |
s := strpas(p); |
1235 |
|
for i := 1 to CharWidth do |
1236 |
|
begin |
1237 |
|
cplen := UTF8CodepointSizeFull(p); |
1269 |
|
if (SQLType = SQL_TEXT) then |
1270 |
|
begin |
1271 |
|
if GetCodePage = cp_utf8 then |
1272 |
< |
str_len := GetStrLen(PAnsiChar(sz),GetSize,DataLength) |
1272 |
> |
str_len := GetStrLen(PAnsiChar(sz),GetSize div GetCharSetWidth,DataLength) |
1273 |
|
else |
1274 |
|
str_len := DataLength |
1275 |
|
end |
1750 |
|
result := FIBXSQLVAR.DataLength; |
1751 |
|
end; |
1752 |
|
|
1753 |
+ |
function TColumnMetaData.GetCharSetWidth: integer; |
1754 |
+ |
begin |
1755 |
+ |
CheckActive; |
1756 |
+ |
result := FIBXSQLVAR.GetCharSetWidth; |
1757 |
+ |
end; |
1758 |
+ |
|
1759 |
|
function TColumnMetaData.GetArrayMetaData: IArrayMetaData; |
1760 |
|
begin |
1761 |
|
CheckActive; |