I am trying to read a UTF-8 text file in Visual C ++ 2010 using only the standard library, not the Boost or Windows API. I define the locale as:
std::locale utf8_locale(std::locale(), new std::codecvt_utf8<wchar_t>);
but this leads to the following compiler error:
error C2661: 'std::locale::facet::operator new' : no overloaded function takes 3 arguments
error C2664: 'std::locale::locale(const char *,std::locale::category)' : cannot convert parameter 1 from 'std::locale' to 'const char *'
source
share