소스 검색

* Complement to fix of case insensitive comparison in Locate/Lookup: handles partial key

git-svn-id: trunk@13426 -
blikblum 16 년 전
부모
커밋
13c881c9ea
1개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  1. 8 1
      packages/fcl-db/src/sqlite/customsqliteds.pas

+ 8 - 1
packages/fcl-db/src/sqlite/customsqliteds.pas

@@ -977,9 +977,16 @@ type
   end;
   end;
 
 
 function CompInsensitivePartial(Value: PChar; const Key: String): Boolean;
 function CompInsensitivePartial(Value: PChar; const Key: String): Boolean;
+var
+  AnsiKey, AnsiValue: AnsiString;
 begin
 begin
+  //see comments of CompInsensitive and CompInsensitiveWild functions
   if Value <> nil then
   if Value <> nil then
-    Result := StrLIComp(Value, PChar(Key), Length(Key)) = 0
+  begin
+    AnsiKey := UTF8Decode(Key);
+    AnsiValue := UTF8Decode(Value);
+    Result := AnsiStrLIComp(PChar(AnsiValue), PChar(AnsiKey), Length(AnsiKey)) = 0;
+  end
   else
   else
     Result := False;
     Result := False;
 end;
 end;