Re: [Boost-users] lexical_cast and string to wstring!

-----Original Message----- From: Thomas Gulbrandsen [mailto:thomas@tansa.no] Sent: Tuesday, March 21, 2006 11:30 AM To: boost-users@lists.boost.org Subject: [Boost-users] lexical_cast and string to wstring!
Hello!
I have to convert a std::wstring to a std::string and tried the following small test program.
But this will not compile on MSVC8.0 or MSVC7.1. Is the boost::lexical_cast suppost to handle this conversion?
As far I know, it's not (corrections, anybody?). My usual method to
perform this conversion on Windows is to use WideCharToMultiByte, found
in the Windows Platform SDK. Note, however, this function is designed
to work with C-style strings and/or fixed-width. You might consider a
function similar to the following (warning: untested code):
#include <string>
#include

Thank you, Andrew! I will check out the ICU Library. Have a nice day :) -Thomas -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org]On Behalf Of Andrew Holden Sent: Tuesday, March 21, 2006 5:59 PM To: boost-users@lists.boost.org Subject: Re: [Boost-users] lexical_cast and string to wstring!
-----Original Message----- From: Thomas Gulbrandsen [mailto:thomas@tansa.no] Sent: Tuesday, March 21, 2006 11:30 AM To: boost-users@lists.boost.org Subject: [Boost-users] lexical_cast and string to wstring!
Hello!
I have to convert a std::wstring to a std::string and tried the following small test program.
But this will not compile on MSVC8.0 or MSVC7.1. Is the boost::lexical_cast suppost to handle this conversion?
As far I know, it's not (corrections, anybody?). My usual method to
perform this conversion on Windows is to use WideCharToMultiByte, found
in the Windows Platform SDK. Note, however, this function is designed
to work with C-style strings and/or fixed-width. You might consider a
function similar to the following (warning: untested code):
#include <string>
#include
participants (2)
-
Andrew Holden
-
Thomas Gulbrandsen