string utf2oem( string const & in_str ) { int n = MultiByteToWideChar( CP_UTF8, 0, in_str.data(), in_str.size(), NULL, 0 ); if( n == 0 ) return in_str; wstring tmp; tmp.resize( n ); int ret = MultiByteToWideChar(CP_UTF8, 0, in_str.data(), in_str.size(), &tmp.front(), tmp.size() ); if( ret == 0 ) return in_str; string out_str; out_str.resize( n ); ret = WideCharToMultiByte(CP_OEMCP, 0, tmp.data(), n, &out_str.front(), n, NULL, NULL); return( ret == 0 ? in_str : out_str ); } I try to use this function but get error : error C2039: 'front' : is not a member of 'std::basic_string<_Elem,_Traits,_Ax>'
So can i use something instead front() in Visual C++ 2008 with boost 1.38?
in_str[0]