2
0
Эх сурвалжийг харах

* avoid crashes when displaying help with an unsupported system codepage

git-svn-id: trunk@30040 -
Tomas Hajny 10 жил өмнө
parent
commit
2be0cc8aae
1 өөрчлөгдсөн 4 нэмэгдсэн , 2 устгасан
  1. 4 2
      compiler/widestr.pas

+ 4 - 2
compiler/widestr.pas

@@ -393,14 +393,16 @@ unit widestr;
            end;
           Result := J;
          end
-        else
+        else if CPAvailable (DefaultSystemCodepage) then
          begin
           GetMem (P2, Succ (L));
           FillChar (P2^, Succ (L), 0);
           ChangeCodePage (P, L, DefaultSystemCodepage, P2, 28591);
           Result := StrLen (P2);
           FreeMem (P2, Succ (L));
-         end;
+         end
+        else
+         Result := L;
 {$ELSE FPC_HAS_CPSTRING}
         Result := L;
 {$ENDIF FPC_HAS_CPSTRING}