I'm unable to set UTF-16, or any form thereof, as locale on my Linux box. The sample code for this:
#include <iostream>
#include <string.h>
#include <locale.h>
using namespace std;
int main()
{
char *ret = std::setlocale(LC_ALL, "en_US.utf16");
if (ret) {
cout << ret << endl;
}
return 0;
}
The output doesn't print the locale set, which means that desired locale was not set.
The list of supported locales on the box does not include any form of UTF-16 encoding. I checked this via locale -a
$ uname -a
Linux developer.com 2.6.32-279.1.1.el6.x86_64 #1 SMP Tue Jul 10 11:24:23 CDT 2012 x86_64 x86_64 x86_64 GNU/Linux
Does something need to be installed to use UTF-16 on the box?