mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-03 15:57:10 +01:00
* avoid crashes when displaying help with an unsupported system codepage
git-svn-id: trunk@30040 -
This commit is contained in:
parent
dbbce18f56
commit
2be0cc8aae
@ -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}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user