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;
+ if (Length(Result) > 0) then begin
+ if (StrByteType(PChar(Result), Length(Result)-1) = mbLeadByte) then begin
+ SetLength(Result, Length(Result) - 1);
+ end;
+ end;
end else begin
Result := s;
s := '';
end;
end;
-//! \96³\8aQ\89»(& -> & " -> &auot; \82É\95Ï\8a·\82·\82é)
+//! \96³\8aQ\89»(& -> & " -> " \82É\95Ï\8a·\82·\82é)
function Sanitize(const s: String): String;
begin
- Result := CustomStringReplace(s, '&', '&');
+ // \97]\95ª\82É\83T\83j\83^\83C\83Y\82³\82ê\82È\82¢\82æ\82¤\82É\82¢\82Á\82½\82ñ\8c³\82É\96ß\82·
+ Result := UnSanitize(s);
+ Result := CustomStringReplace(Result, '&', '&');
Result := CustomStringReplace(Result, '"', '"');
end;
-//! \96³\8aQ\89»\89ð\8f\9c(& -> & &auot; -> " \82É\95Ï\8a·\82·\82é)
+//! \96³\8aQ\89»\89ð\8f\9c(& -> & " -> " \82É\95Ï\8a·\82·\82é)
function UnSanitize(const s: String): String;
begin
Result := CustomStringReplace(s, '"', '"');