Page 1 of 1

Cannot use cyrillic paths for cef binaries

Posted: Wed Jun 10, 2020 7:33 am
by eldred
Hello, I am using cef4delphi to embed a browser in my lazarus (2.0.8) project.
Setting paths like this:

Code: Select all

  GlobalCEFApp.FrameworkDirPath:=ExtractFilePath(ParamStr(0)) + 'cef';
  GlobalCEFApp.ResourcesDirPath:=ExtractFilePath(ParamStr(0)) + 'cef';
  GlobalCEFApp.LocalesDirPath:=ExtractFilePath(ParamStr(0)) + 'cef\locales';
  GlobalCEFApp.cache:=ExtractFilePath(ParamStr(0)) + 'cef\cache';
  GlobalCEFApp.UserDataPath:=ExtractFilePath(ParamStr(0)) + 'cef\User Data';
Everything works fine as long as paths conatin english letters, but cef is unable to start if path contains other languages symbols

Specifically, the following returns false at checking DLL version stage in uCEFApplicationCore.pas:

Code: Select all

          if CheckDLLVersion(LibCefPath,
                             CEF_SUPPORTED_VERSION_MAJOR,
                             CEF_SUPPORTED_VERSION_MINOR,
                             CEF_SUPPORTED_VERSION_RELEASE,
                             CEF_SUPPORTED_VERSION_BUILD) then 
I am sure my project has default lazarus/fpc unicode support enabled, and tried different workarounds such as converting my strings to utf16 or assigning constants to string type first, but nothing changed.

Re: Cannot use cyrillic paths for cef binaries

Posted: Wed Jun 10, 2020 9:30 am
by salvadordf
Hi,

Thanks for reporting this issue! :)

I'll take a look as soon as I can.

Re: Cannot use cyrillic paths for cef binaries

Posted: Wed Jun 10, 2020 9:43 am
by eldred
if I set

Code: Select all

GlobalCEFApp.CheckCEFFiles:=false;
then that error is skipped, but the following fails:

Code: Select all

  {$IFDEF MSWINDOWS}
  FLibHandle := LoadLibraryEx(PChar(LibCefPath), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
  {$ELSE}
  FLibHandle := LoadLibrary(PChar(LibCefPath));
  {$ENDIF} 

Re: Cannot use cyrillic paths for cef binaries

Posted: Wed Jun 10, 2020 5:54 pm
by eldred
Forgot to add, this problem also happens with demos to me.
If I just compile simplebrowser demo without changing it, it works.
Then if I rename simplebrowser folder to rus name and try to run the newly created simplebrowser.exe, I get "CEF binaries missing" with a list of all cef binaries that are present in distribution and are inside my folder now

Re: Cannot use cyrillic paths for cef binaries

Posted: Sat Jun 13, 2020 3:29 pm
by salvadordf
Please download CEF4Delphi again.

I just uploaded a new version that should fix that issue with unicode characters.

Re: Cannot use cyrillic paths for cef binaries

Posted: Mon Jun 15, 2020 9:55 pm
by eldred
Thank you very much for your work. I use older version of cef4delphi (80.0.3987.163) in my (non-commercial) app and it is already distributed. While it has internal updater, I would like to avoid users downloading 250mb of new cef binaries. Will this fix work if I jury-rig your latest commit to sources of cef4delphi version I use now?

Re: Cannot use cyrillic paths for cef binaries

Posted: Tue Jun 16, 2020 7:40 am
by salvadordf
Yes, it will work.

You will need to apply the code changes in this commit :
https://github.com/salvadordf/CEF4Delph ... 158ca449e2