Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C++

ASCII strings to Unicode in C++

0.00/5 (No votes)
14 May 2011CPOL 7.1K  
inline std::wstring AsciiToUnicode(std::string text){ // Could do some DEBUG check here to ensure it is really ASCII. // Also, if in the future, it is found, it is not the case, // it would much easier to update code. // Same as jean Davy here... return...
inline std::wstring AsciiToUnicode(std::string text)
{
    // Could do some DEBUG check here to ensure it is really ASCII.
    // Also, if in the future, it is found, it is not the case, 
    // it would much easier to update code.

    // Same as jean Davy here...
    return std::wstring(text.begin(), text.end());
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)