Result := StrPosEx(StrStart, StrEnd, SubstrStart, SubstrEnd);
while (Result <> nil) and (StrEnd - Result >= L2) do begin
- ByteType := StrByteType(StrStart, Integer(Result-StrStart));
- if (ByteType <> mbTrailByte) and
- (CompareString(LOCALE_USER_DEFAULT, SORT_STRINGSORT, Result, L2, SubstrStart, L2) = 2)
- then Exit;
+ ByteType := StrByteType(StrStart, Integer(Result-StrStart));
+ if (ByteType <> mbTrailByte) and
+ (CompareString(LOCALE_USER_DEFAULT, SORT_STRINGSORT, Result, L2, SubstrStart, L2) = 2)
+ then Exit;
if (ByteType = mbLeadByte) then Inc(Result);
Inc(Result);
Result := StrPosEx(Result, StrEnd, SubStrStart, SubStrEnd);
pds := PChar(delimiter);
pde := pds + Length(delimiter);
- pos := AnsiStrPosEx(pss, pse, pds, pde);
+ pos := StrPosEx(pss, pse, pds, pde);
if pos <> nil then begin
p := pos - pss;
SetString(Result, pss, p);
Delete(s, 1, p + Length(delimiter));
+
+ if (StrByteType(PChar(Result), Length(Result)-1) = mbLeadByte) then begin
+ SetLength(Result, Length(Result) - 1);
+ end;
end else begin
Result := s;
s := '';
end;
end;
+
//! \96³\8aQ\89»(& -> & " -> &auot; \82É\95Ï\8a·\82·\82é)
function Sanitize(const s: String): String;
begin