Click here to Skip to main content
15,880,392 members

Comments by Nemanja Trifunovic (Top 19 by date)

Nemanja Trifunovic 13-May-11 8:31am View    
Deleted
That's fine - just be aware that it solves a slightly different problem: converting UTF-16 to/from current system code page, which can really be anything. Internaly it uses Windows conversion API.
Nemanja Trifunovic 14-Apr-11 11:43am View    
+5.
Nemanja Trifunovic 12-Apr-11 14:07pm View    
Why does this question have MemoryBarrier tag?
Nemanja Trifunovic 4-Apr-11 22:50pm View    
Deleted
As I repeated several times: this is from ASCII to Unicode. ASCII characters are *always* < 127. Encoding detection is way beyond the scope of this little tip.
Nemanja Trifunovic 30-Mar-11 14:19pm View    
Deleted
The sample could be improved. std::string is guaranteed to store memory in a single block (well, at least in C++ 2011, but all current STL implementations do that anyway) so you can just reserve the string buffer with an appropriate size (which BTW needs to be done via a separate call to WideCharToMultiByte - your sample will work only for ASCII characters) and pass it directly instead of dealing with a temporary array.