65.9K
CodeProject is changing. Read more.
Home

ASCII strings to Unicode in C++

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

May 14, 2011

CPOL
viewsIcon

7132

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());
}