"red floyd" <no*****@here.dude> wrote in message news:I3***************@newssvr29.news.prodigy.com. ..
I have a an app that I'm writing which uses char and std::string. I'm using
a library which expects wchar_t arrays.
Is there a standard way to convert between std::string and std::wstring, or do
I need to use something like std::transform()?
Well, there's no real PORTABLE way... it might not even be possible. The whole
concept of the mapping between mb to wc characters is highly implemetnation
dependent. C++ is rather schizoid about whether it's multibyte or wide character
based having a complete implementation of neither.
The best bet is the codecvt C++ class or the mbtowc family of functions in the
C library. All of these work on arrays of characters and not strings, you could
use transform to warp calls to these, but there's no canned function that
does what you want I suspect.