main.cpp
std::wstring utf8_decode(const std::string& str)
{
    if (str.empty()) return std::wstring();
    int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
    std::wstring wstrTo(size_needed, 0);
    MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], size_needed);
    return wstrTo;
}
// Convert an UTF8 string to a wide Unicode String
Convert an UTF8 string to a wide Unicode String
Convert an UTF8 string to a wide Unicode String
std::wstring utf8_decode(const std::string& str)
{
    if (str.empty()) return std::wstring();
    int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), NULL, 0);
    std::wstring wstrTo(size_needed, 0);
    MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], size_needed);
    return wstrTo;
}
std :: wstring utf8_decode ( const std :: string & str ) { if ( str . empty ( ) ) return std :: wstring ( ) ; int size_needed = MultiByteToWideChar ( CP_UTF8 , 0 , & str [ 0 ] , ( int ) str . size ( ) , NULL , 0 ) ; std :: wstring wstrTo ( size_needed , 0 ) ; MultiByteToWideChar ( CP_UTF8 , 0 , & str [ 0 ] , ( int ) str . size ( ) , & wstrTo [ 0 ] , size_needed ) ; return wstrTo ; }
Convert an UTF8 string to a wide Unicode String
Convert an UTF8 string to a wide Unicode String