Closed HashidaTKS closed 1 year ago
文字化けしている。c_str()
関係の直し方が悪いのだろう。。。
LPCTSTR hoge = fuga.ToWString().c_str()
だと、ToWString()
で新しく作られた文字列が保存されていなくて解放されてしまうから駄目なのかぁ。。。
うーん、そもそもCefStringTraitsUTF16じゃなくてCefStringTraitsWideが使われているべきなのでは?
https://magpcss.org/ceforum/apidocs3/projects/(default)/cef_string.h.html
を
// Build with the UTF16 string type as default.
// #define CEF_STRING_TYPE_UTF16 1
// Build with the wide string type as default.
#define CEF_STRING_TYPE_WIDE 1
というように直してsetup-cefを再実行し、Chronos側に型変換関係のいくつかの修正を入れれば動く。 動くのだが、上記の部分のコメントにあるように、CEF全体のリビルドが必要とあるので、本当にこれで大丈夫なのか疑問である。
(自分でCEFをビルドしている場合は大丈夫。公式のパッケージを使っている現在の自動ビルドでは駄目な気がする。)
うーん、動いているけど、何故無事に動いているのか疑問。
setup-cef.batではlibcef_dll_wrapperしか作っていなくて、libcef.dllなどはパッケージに含まれるものを使っている。
このとき、libcef.dllはCEF_STRING_TYPE_UTF16 1
の状態でビルドされているはずで、libcef_dll_wrapperはCEF_STRING_TYPE_WIDE 1
でビルドされることになる。
文字列型に違いがあるので、どこかで文字化けなり何か起きそうなのだが、特に問題なく動いている。
https://magpcss.org/ceforum/viewtopic.php?f=6&t=19507&p=53846#p53846
ちょっとよくわからないのでフォーラムで聞いてみた。
On Windows, wchar_t is UTF-16 so you can reinterpret_cast<> between wchar_t and char16_t.
とのことなので、単にcastするようにしてみる。
ありがとうございます!
Which issue(s) this PR fixes:
93
What this PR does / why we need it:
最新のCEFに追従。
uint32
からuint32_t
になったchar16
からchar16_t
になったCefSettings.user_data_path
が廃止されroot_cache_path
となったので追従CefX509CertPrincipal.GetStreetAddresses
が廃止されたので追従How to verify the fixed issue:
The steps to verify:
1. 2.
Expected result: