Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Cannot use cyrillic paths for cef binaries

Post Reply
eldred
Posts: 4
Joined: Wed Jun 10, 2020 6:59 am

Cannot use cyrillic paths for cef binaries

Post 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.
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cannot use cyrillic paths for cef binaries

Post by salvadordf »

Hi,

Thanks for reporting this issue! :)

I'll take a look as soon as I can.
eldred
Posts: 4
Joined: Wed Jun 10, 2020 6:59 am

Re: Cannot use cyrillic paths for cef binaries

Post 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} 
eldred
Posts: 4
Joined: Wed Jun 10, 2020 6:59 am

Re: Cannot use cyrillic paths for cef binaries

Post 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
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cannot use cyrillic paths for cef binaries

Post by salvadordf »

Please download CEF4Delphi again.

I just uploaded a new version that should fix that issue with unicode characters.
eldred
Posts: 4
Joined: Wed Jun 10, 2020 6:59 am

Re: Cannot use cyrillic paths for cef binaries

Post 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?
User avatar
salvadordf
Posts: 4016
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Cannot use cyrillic paths for cef binaries

Post by salvadordf »

Yes, it will work.

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