STL_Algorithm.h : #ifndef __H_STL_Algorithm__ #define __H_STL_Algorithm__ #include <iostream> #include <algorithm> #include <string> using namespace std; void Transform(); #endif STL_Algorithm.cpp: #include "stdafx.h" #include "STL_Algorithm.h" #include <windows.h> void Transform() { // Q: How does the tolower function works for wchar_t type? But it really works! wstring str = L"Hello, world!"; std::transform(str.begin(), str.end(), str.begin(), tolower); std::wcout << str << endl; wchar_t ch = L'A'; wchar_t ch2 = (wchar_t)tolower(ch); std::wcout << ch2 << endl; // But the std::wcout dose not support Chinese character, nor dose the file i/o stream. // So how to support localization using standered C++ i/o stream ? str = L"程序员"; std::wcout << str; // But this works! ::MessageBox(NULL, str.c_str(), NULL, NULL); } main.cpp #include "stdafx.h" #include "STL_Algorithm.h" int _tmain(int argc, _TCHAR* argv[]) { Transform(); char wait; cin >> wait; return 0; }