From a7cab840e7326b7a4e905dfe7d761e0120c9e46b Mon Sep 17 00:00:00 2001 From: macpgmr Date: Fri, 22 Jul 2016 18:19:20 +0000 Subject: [PATCH] HelpUtil: replace Shell with fpSystem; PropListUtil: fix to always return UTF8, as encoded. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5024 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/xdev_toolkit/HelpUtil.pas | 4 ++-- components/xdev_toolkit/PropListUtil.pas | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/xdev_toolkit/HelpUtil.pas b/components/xdev_toolkit/HelpUtil.pas index 3936d9531..82d5ae577 100644 --- a/components/xdev_toolkit/HelpUtil.pas +++ b/components/xdev_toolkit/HelpUtil.pas @@ -123,7 +123,7 @@ begin Result := shrSuccess; {$ELSE} {$IFDEF DARWIN} - if Shell('Open -a "HelpViewer" "' + Application.HelpFile + '"') = 127 then + if fpSystem('Open -a "HelpViewer" "' + Application.HelpFile + '"') = 127 then // Note: Renamed from Help Viewer.app to HelpViewer.app with 10.5. // // Note: With OS X earlier than 10.4 (Tiger), if connected to network @@ -137,7 +137,7 @@ begin {$ELSE} {For now, shell to first browser found, passing help file name} if GetBrowserPath <> '' then {Found a browser?} begin - if Shell(GetBrowserPath + ' ' + Application.HelpFile) = 127 then + if fpSystem(GetBrowserPath + ' ' + Application.HelpFile) = 127 then Result := shrViewerError else Result := shrSuccess; diff --git a/components/xdev_toolkit/PropListUtil.pas b/components/xdev_toolkit/PropListUtil.pas index 1334abc81..05bccae5e 100644 --- a/components/xdev_toolkit/PropListUtil.pas +++ b/components/xdev_toolkit/PropListUtil.pas @@ -131,7 +131,7 @@ begin if not Assigned(Value) then {Key not found?} Exit; if CFGetTypeID(Value) = CFStringGetTypeID then {Value is a string?} - Result := CFStrToAnsiStr(Value); + Result := CFStrToAnsiStr(Value, kCFStringEncodingUTF8); //will always be UTF8 end; @@ -166,7 +166,7 @@ begin ValueRef := CFBundleGetValueForInfoDictionaryKey(BundleRef, KeyRef); if CFGetTypeID(ValueRef) <> CFStringGetTypeID then {Value not a string?} Exit; - Result := CFStrToAnsiStr(ValueRef); + Result := CFStrToAnsiStr(ValueRef, kCFStringEncodingUTF8); //will always be UTF8 finally FreeCFRef(KeyRef); end;