diff --git a/ohos_nweb/src/nweb_inputmethod_handler.cc b/ohos_nweb/src/nweb_inputmethod_handler.cc index 780defce42c048027232221ebb7d34472b221336..18d3683f12f41cb2830843cb62f2f7485a8cf911 100644 --- a/ohos_nweb/src/nweb_inputmethod_handler.cc +++ b/ohos_nweb/src/nweb_inputmethod_handler.cc @@ -25,6 +25,7 @@ #include "base/functional/callback_helpers.h" #include "base/logging.h" #include "base/ohos/sys_info_utils.h" +#include "base/strings/utf_string_conversion_utils.h" #include "cef/include/cef_task.h" #include "content/public/browser/browser_thread.h" #include "libcef/browser/thread_util.h" @@ -1335,8 +1336,8 @@ void NWebInputMethodHandler::AutoFillWithIMFEventOnUI( #if defined(OHOS_CLIPBOARD) std::string NWebInputMethodHandler::GetSelectInfo() { - std::wstring_convert, char16_t> converter; - return converter.to_bytes(selected_text_); + std::string selected_str = base::UTF16ToUTF8(selected_text_); + return selected_str; } #endif