X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=MojuUtils.pas;h=4c87fb011792ec733405bf2e32ff2d88a2191ea6;hb=ed262f6cd989d300228e6de1a3546e80dbbfa3f3;hp=4291e209341408de5439aea6f94f053f06440b73;hpb=c6cb85e0e425ab468b7f09cbcc9e7a909c47a610;p=gikonavigoeson%2Fgikonavi.git diff --git a/MojuUtils.pas b/MojuUtils.pas index 4291e20..4c87fb0 100644 --- a/MojuUtils.pas +++ b/MojuUtils.pas @@ -366,23 +366,26 @@ 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; + 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; -//! –³ŠQ‰»(& -> & " -> &auot; ‚É•ÏŠ·‚·‚é) +//! –³ŠQ‰»(& -> & " -> " ‚É•ÏŠ·‚·‚é) function Sanitize(const s: String): String; begin - Result := CustomStringReplace(s, '&', '&'); + // —]•ª‚ɃTƒjƒ^ƒCƒY‚³‚ê‚È‚¢‚悤‚É‚¢‚Á‚½‚ñŒ³‚É–ß‚· + Result := UnSanitize(s); + Result := CustomStringReplace(Result, '&', '&'); Result := CustomStringReplace(Result, '"', '"'); end; -//! –³ŠQ‰»‰ðœ(& -> & &auot; -> " ‚É•ÏŠ·‚·‚é) +//! –³ŠQ‰»‰ðœ(& -> & " -> " ‚É•ÏŠ·‚·‚é) function UnSanitize(const s: String): String; begin Result := CustomStringReplace(s, '"', '"');