From e44698555e7a8b55a641562b89dbb028e028e081 Mon Sep 17 00:00:00 2001 From: h677 Date: Sun, 26 Feb 2006 04:12:03 +0000 Subject: [PATCH] =?utf8?q?<>=E3=81=AE=E7=9B=B4=E5=89=8D=E3=81=ABShiftJIS?= =?utf8?q?=E3=81=AE1byte=E7=9B=AE=E3=81=8C=E3=81=84=E3=82=8B=E3=81=A8?= =?utf8?q?=E3=83=91=E3=83=BC=E3=82=B9=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84?= =?utf8?q?=E4=B8=8D=E5=85=B7=E5=90=88=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- MojuUtils.pas | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/MojuUtils.pas b/MojuUtils.pas index 71fbd9c..fe4aa58 100644 --- a/MojuUtils.pas +++ b/MojuUtils.pas @@ -103,10 +103,10 @@ begin 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); @@ -352,16 +352,21 @@ begin 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; + //! –³ŠQ‰»(& -> & " -> &auot; ‚É•ÏŠ·‚·‚é) function Sanitize(const s: String): String; begin -- 2.11.0