Change CEF_STRING_TYPE

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Change CEF_STRING_TYPE

Postby TakashiHSD » Fri Jul 07, 2023 12:27 am

Hi, I am trying to change CEF_STRING_TYPE to CEF_STRING_TYPE_WIDE from CEF_STRING_TYPE_UTF16 in https://github.com/chromiumembedded/cef/blob/master/include/internal/cef_string.h.
I am using the Minimal Distribution for windows32 https://cef-builds.spotifycdn.com/index.html#windows32.

cef_string.h says "// If you change the default you MUST recompile all of CEF.".

Does it mean we should re-build not only libcef_dll_wrapper.dll(lib), means modules we can build with the distributed package, but also libcef.dll(lib) and so on?
It seems to work fine by only re-building libcef_dll_wrapper.dll(lib), but I'm not sure if this is really okay.

Background

The char_type of CefString (CefStringTraitsUTF16) have changed to char16_t from char16 since CEF 115.
Char16 was wchar_t on my environment, so the type of CefString.c_str() have changed from wchar_t to char16_t.
Our product uses CefString.c_str() in many places, so I would like to change the default CefString type to CEF_STRING_TYPE_WIDE.

Any help would be much appreciated, thanks!
TakashiHSD
Newbie
 
Posts: 7
Joined: Mon Apr 17, 2023 2:19 am

Re: Change CEF_STRING_TYPE

Postby magreenblatt » Fri Jul 07, 2023 2:21 am

What OS are you using? On Windows, wchar_t is UTF-16 so you can reinterpret_cast<> between wchar_t and char16_t. On other platforms it is UTF-32 so you need to use conversion functions.

Does it mean we should re-build not only libcef_dll_wrapper.dll(lib), means modules we can build with the distributed package, but also libcef.dll(lib) and so on?

Yes.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Change CEF_STRING_TYPE

Postby TakashiHSD » Fri Jul 07, 2023 3:34 am

> What OS are you using?

I'm using Windows.

> On Windows, wchar_t is UTF-16 so you can reinterpret_cast<> between wchar_t and char16_t.

Oh, I will try it! Thanks!
TakashiHSD
Newbie
 
Posts: 7
Joined: Mon Apr 17, 2023 2:19 am

Re: Change CEF_STRING_TYPE

Postby TakashiHSD » Mon Jul 24, 2023 3:36 am

TakashiHSD wrote:> What OS are you using?

I'm using Windows.

> On Windows, wchar_t is UTF-16 so you can reinterpret_cast<> between wchar_t and char16_t.

Oh, I will try it! Thanks!


It worked fine! Thanks!
TakashiHSD
Newbie
 
Posts: 7
Joined: Mon Apr 17, 2023 2:19 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 207 guests