Просмотр исходного кода

* fixed wrong use of CompareTextUnicodeStringProc() in
fpc_ansistr_compare_equal(). "make cycle" now works under Linux, but
there is probably still a bug somewhere because I don't think that the
compiler should ever trigger the code path the contained this bug

git-svn-id: trunk@19139 -

Jonas Maebe 14 лет назад
Родитель
Сommit
85ed1b87d9
1 измененных файлов с 9 добавлено и 1 удалено
  1. 9 1
      rtl/inc/astrings.inc

+ 9 - 1
rtl/inc/astrings.inc

@@ -726,7 +726,15 @@ begin
       r2:=S2;
       if (cp2=$ffff) or (cp2=0) then
         SetCodePage(r2,DefaultSystemCodePage,false);
-      Result:=widestringmanager.CompareTextUnicodeStringProc(UnicodeString(r1),UnicodeString(r2));
+      //convert them to utf8 then compare
+      SetCodePage(r1,65001);
+      SetCodePage(r2,65001);
+      Maxi:=Length(r1);
+      temp:=Length(r2);
+      Result := Maxi - temp;
+      if Result = 0 then
+        if MaxI>0 then
+          result:=CompareByte(r1[1],r2[1],MaxI);
     end;
 end;