Use L before wstring

wstring wString = L"test";

When you need yo convert wstring to string or char* in C++, just use

    string wstringChangedToString(wString.begin(), wString.end());

The code shows how to convert and compare wstring to string and string to wstring

#include 

using namespace std;

int main(int argc, char **argv) {

    string stdString = "test";
    wstring wString = L"test";

    string wstringChangedToString(wString.begin(), wString.end());


    if (wstringChangedToString == stdString) {
        cout << "Strings are same" << endl;
        cout << stdString << " == " << wstringChangedToString << endl;
    } else {
        cout << "Strings are not same" << endl;
        cout << stdString << " != " << wstringChangedToString << endl;
    }
}