Not really - wide character strings aren't just a simple modification of adding
L's to your program. you need to use the wide character string type and related I/O streams too.
There's no point in storing simple strings (eg, "hello") in wide character format - since not only does it complicate things (wchar_t has no standard defined size, and its representations vary), it usually uses more bytes than necessary too.
Internationalisation extends beyond wide characters into areas such as number representation, date representation, etc. The usual approach is to write the user interface portion separately, then only the UI will be concerned with these issues, allowing the rest of the program to continue internally without having to worry about how it looks to the outside world.
If you want to make a habit of using wchar_t for everything, then feel free. although the more common approach is a conversion function to widen or narrow strings as you need to. eg,
Code:
#include <iostream>
#include <string>
#include <locale>
std::wstring widen_string(std::string str)
{
std::wstring result;
std::locale loc;
for(int i(0); i < str.size(); ++i)
{
result += std::use_facet<std::ctype<wchar_t> >(loc).widen(str[i]);
}
return result;
}
int main()
{
std::string str = "hello, world";
std::wcout << widen_string(str);
}