Click here to Skip to main content
12,065,204 members (43,633 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

11.7K views
4 bookmarked
Posted

ASCII strings to Unicode in C++

, 28 Mar 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
std::string source = "Hello World";std::wstring result( source.begin(), source.end() );One coding line less !
std::string source = "Hello World";
std::wstring result( source.begin(), source.end() );
One coding line less !

License

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

Share

About the Author

jean Davy
Engineer
France France
I'm an independent Software Developer living in the Alpes Maritimes (aka French Riviera).

Even if in the past I have worked regularily with Fortran, Pascal, Basic (not necessarily Visual), and much more esoteric languages (who knows Prolog, Lotus 123 macros ?), even if I still work from time to time with C#, Java or some "interpreted languages", I'm more specialized in C++.
I work on MFC since the very first version, I enjoy working on Visual Studio 2010, its C++0x features, STL, MFC, boost, WTL ...

You may also be interested in...

Comments and Discussions

 
GeneralYeah I am well aware about the topic. I was sharing my exper... Pin
Mital D Vora30-Mar-11 4:22
memberMital D Vora30-Mar-11 4:22 
GeneralRe: Well, you said: "but when you are dealing with unicode data ... Pin
Nemanja Trifunovic30-Mar-11 6:07
memberNemanja Trifunovic30-Mar-11 6:07 
GeneralThis works fine for all ASCII strings but when you are deali... Pin
Mital D Vora29-Mar-11 17:34
memberMital D Vora29-Mar-11 17:34 
GeneralRe: Mital, please check the title of the tip: "ASCII strings to ... Pin
Nemanja Trifunovic30-Mar-11 3:42
memberNemanja Trifunovic30-Mar-11 3:42 
GeneralYep, very good :) Pin
Nemanja Trifunovic29-Mar-11 3:58
memberNemanja Trifunovic29-Mar-11 3:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160204.4 | Last Updated 28 Mar 2011
Article Copyright 2011 by jean Davy
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid