mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Running DC from directory with not ACSII characters
This commit is contained in:
parent
1a6a823e94
commit
909928fa90
8 changed files with 28 additions and 13 deletions
|
|
@ -13,7 +13,7 @@ procedure LoadPaths;
|
|||
|
||||
implementation
|
||||
uses
|
||||
LCLProc, SysUtils, uClassesEx, uFileProcs, uOSUtils;
|
||||
LCLProc, SysUtils, FileUtil, uClassesEx, uFileProcs, uOSUtils;
|
||||
|
||||
function GetAppName : String;
|
||||
begin
|
||||
|
|
@ -24,7 +24,7 @@ procedure LoadPaths;
|
|||
var
|
||||
Ini : TIniFileEx;
|
||||
begin
|
||||
gpExePath := ExtractFilePath(ParamStr(0));
|
||||
gpExePath := ExtractFilePath(SysToUTF8(ParamStr(0)));
|
||||
DebugLn('Executable directory: ', gpExePath);
|
||||
|
||||
gpCfgDir := gpExePath;
|
||||
|
|
|
|||
17
uOSUtils.pas
17
uOSUtils.pas
|
|
@ -25,7 +25,7 @@ unit uOSUtils;
|
|||
interface
|
||||
|
||||
uses
|
||||
SysUtils, Classes, LCLProc, uDCUtils, uFindEx, uClassesEx
|
||||
SysUtils, Classes, LCLProc, dynlibs, uDCUtils, uFindEx, uClassesEx
|
||||
{$IFDEF MSWINDOWS}
|
||||
, Windows, ShellApi, uNTFSLinks, uMyWindows, JwaWinNetWk
|
||||
{$ELSE}
|
||||
|
|
@ -212,6 +212,7 @@ function mbSetCurrentDir(const NewDir: UTF8String): Boolean;
|
|||
function mbDirectoryExists(const Directory : UTF8String) : Boolean;
|
||||
function mbCreateDir(const NewDir: UTF8String): Boolean;
|
||||
function mbRemoveDir(const Dir: UTF8String): Boolean;
|
||||
function mbLoadLibrary(Name: UTF8String): TLibHandle;
|
||||
|
||||
implementation
|
||||
|
||||
|
|
@ -1152,4 +1153,18 @@ begin
|
|||
end;
|
||||
{$ENDIF}
|
||||
|
||||
function mbLoadLibrary(Name: UTF8String): TLibHandle;
|
||||
{$IFDEF MSWINDOWS}
|
||||
var
|
||||
wsName: WideString;
|
||||
begin
|
||||
wsName:= UTF8Decode(Name);
|
||||
Result:= LoadLibraryW(PWideChar(wsName));
|
||||
end;
|
||||
{$ELSE}
|
||||
begin
|
||||
Result:= LoadLibrary(Name);
|
||||
end;
|
||||
{$ENDIF}
|
||||
|
||||
end.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ unit udsxmodule;
|
|||
interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, dynlibs,LCLProc,uGlobs,udsxplugin,uClassesEx, uDCUtils;
|
||||
Classes, SysUtils, dynlibs,LCLProc,uGlobs,udsxplugin,uClassesEx, uDCUtils, uOSUtils;
|
||||
|
||||
type
|
||||
|
||||
|
|
@ -133,7 +133,7 @@ end;
|
|||
|
||||
function TDsxModule.LoadModule: Boolean;
|
||||
begin
|
||||
FModuleHandle := LoadLibrary(Self.FileName);
|
||||
FModuleHandle := mbLoadLibrary(Self.FileName);
|
||||
Result := (FModuleHandle <> 0);
|
||||
if FModuleHandle = 0 then exit;
|
||||
|
||||
|
|
|
|||
6
ulng.pas
6
ulng.pas
|
|
@ -255,17 +255,17 @@ begin
|
|||
DebugLn('Loading lng file: ' + gpLngDir + sFileName);
|
||||
|
||||
gPOFileName := sFileName;
|
||||
if not FileExists(gpLngDir + gPOFileName) then
|
||||
if not mbFileExists(gpLngDir + gPOFileName) then
|
||||
begin
|
||||
gPOFileName := 'doublecmd.%s.po';
|
||||
GetLanguageIDs(Lang, FallbackLang);
|
||||
gPOFileName := Format(gPOFileName,[FallbackLang]);
|
||||
end;
|
||||
if not FileExists(gpLngDir + gPOFileName) then
|
||||
if not mbFileExists(gpLngDir + gPOFileName) then
|
||||
begin
|
||||
gPOFileName := Format(gPOFileName,[Lang]);
|
||||
end;
|
||||
if FileExists(gpLngDir + gPOFileName) then
|
||||
if mbFileExists(gpLngDir + gPOFileName) then
|
||||
begin
|
||||
Translations.TranslateUnitResourceStrings('uLng', gpLngDir + gPOFileName);
|
||||
LRSTranslator := TTranslator.Create(gpLngDir + gPOFileName);
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ var
|
|||
PackDefaultParamStruct : pPackDefaultParamStruct;
|
||||
SetDlgProcInfo: TSetDlgProcInfo;
|
||||
begin
|
||||
FModuleHandle := LoadLibrary(sName);
|
||||
FModuleHandle := mbLoadLibrary(sName);
|
||||
Result := (FModuleHandle <> 0);
|
||||
if FModuleHandle = 0 then exit;
|
||||
//DebugLN('FModuleHandle =', FModuleHandle);
|
||||
|
|
|
|||
|
|
@ -535,7 +535,7 @@ end;
|
|||
|
||||
function TPluginWDX.LoadModule: Boolean;
|
||||
begin
|
||||
FModuleHandle := LoadLibrary(Self.FileName);
|
||||
FModuleHandle := mbLoadLibrary(Self.FileName);
|
||||
Result := (FModuleHandle <> 0);
|
||||
if FModuleHandle = 0 then exit;
|
||||
{Mandatory}
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ end;
|
|||
|
||||
function TWFXModule.LoadModule(const sName: String): Boolean;
|
||||
begin
|
||||
FModuleHandle := LoadLibrary(sName);
|
||||
FModuleHandle := mbLoadLibrary(sName);
|
||||
Result := (FModuleHandle <> 0);
|
||||
if FModuleHandle = 0 then exit;
|
||||
{Mandatory}
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ type
|
|||
|
||||
implementation
|
||||
uses
|
||||
FileUtil;
|
||||
FileUtil, uOSUtils;
|
||||
|
||||
function WlxPrepareContainer(Ahandle: THandle; revert:boolean=false): boolean;
|
||||
{$IFNDEF LCLWIN32}
|
||||
|
|
@ -202,7 +202,7 @@ end;
|
|||
function TWLXModule.LoadModule: Boolean;
|
||||
begin
|
||||
// DebugLn('WLXM LoadModule entered');
|
||||
FModuleHandle := LoadLibrary(Self.FileName);
|
||||
FModuleHandle := mbLoadLibrary(Self.FileName);
|
||||
Result := (FModuleHandle <> 0);
|
||||
if FModuleHandle = 0 then exit;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue