If you only call tolower, it is called std::tolowerfrom the header clocale, which will toloweronly call the character for ansi.
:
template< class charT >
charT tolower( charT ch, const locale& loc );
2 , :
#include <iostream>
#include <cwctype>
#include <clocale>
#include <algorithm>
#include <locale>
int main() {
std::setlocale(LC_ALL, "");
std::wstring data = L"Đ Â Ă Ê Ô Ơ Ư Ấ Ắ Ế Ố Ớ Ứ Ầ Ằ Ề Ồ Ờ Ừ Ậ Ặ Ệ Ộ Ợ Ự";
std::wcout << data << std::endl;
for(auto c: data)
{
std::wcout << static_cast<wchar_t>(std::towlower(c));
}
std::wcout << std::endl;
std::locale loc("");
for(auto c: data)
{
std::wcout << std::tolower(c, loc);
}
std::wcout << std::endl;
return 0;
}
: