Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vossjannik/b99828d61fd9607ce8644475c3f49bea to your computer and use it in GitHub Desktop.
Save vossjannik/b99828d61fd9607ce8644475c3f49bea to your computer and use it in GitHub Desktop.
C++ Narrow To Wide String Conversion
std::wstring widen (const std::string& narrow)
{
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
return converter.from_bytes(narrow);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment