Click here to Skip to main content
15,881,757 members
Articles / Programming Languages / C++
Alternative
Tip/Trick

ASCII strings to Unicode in C++

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
14 May 2011CPOL 6.9K   3  
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)


Written By
Software Developer (Senior)
Canada Canada
Programmer at Maid LABS from 2003 (www.maidlabs.com)

Programmer-Analyst at Viasat Geo Technoligies from 1995 to 2002 (www.viasat-geo.com).

I have studied at École Polytechnique de Montréal in computer engineering.

Comments and Discussions

 
-- There are no messages in this forum --