Page tree
Skip to end of metadata
Go to start of metadata

std::wstring FB::utf8_to_wstring ( const std::string &  src)

Accepts a UTF8-encoded std::string and returns a std::wstring.

Parameters
srcSource string
Returns
std::wstring representation

Definition at line 50 of file utf8_tools.cpp.

Referenced by FB::ActiveX::AXDOM::Window::alert(), FB::ActiveX::AXDOM::Document::createElement(), FB::ActiveX::AXDOM::Document::getElementById(), FB::ActiveX::AXDOM::Element::getElementsByTagName(), FB::ActiveX::AXDOM::Document::getElementsByTagName(), FB::ActiveX::IDispatchAPI::GetProperty(), FB::ActiveX::IDispatchAPI::HasMethod(), FB::ActiveX::IDispatchAPI::HasProperty(), FB::ActiveX::ActiveXBrowserHost::Navigate(), FB::ActiveX::IDispatchAPI::RemoveProperty(), and FB::ActiveX::IDispatchAPI::SetProperty().

50  {
51  std::wstring out_str;
52  std::string in_str;
53  utf8::replace_invalid(src.begin(), src.end(), std::back_inserter(in_str));
54 #ifdef _WIN32
55  utf8::utf8to16(in_str.begin(), in_str.end(), std::back_inserter(out_str));
56 #else
57  utf8::utf8to32(in_str.begin(), in_str.end(), std::back_inserter(out_str));
58 #endif
59  return out_str;
60  }
  • No labels