function GetNBytesChar(s: Ansistring; n: Integer): string;
var
aStr: AnsiString;
bStr: WideString;
begin
aStr := Copy(s, 1, n);
bStr := aStr;
if aStr = bStr then
Result := astr
else
Result := Copy(s, 1, n-1);
end;
2023-12-01 14:57:22
function GetNBytesChar(s: Ansistring; n: Integer): string;
var
aStr: AnsiString;
bStr: WideString;
begin
aStr := Copy(s, 1, n);
bStr := aStr;
if aStr = bStr then
Result := astr
else
Result := Copy(s, 1, n-1);
end;