#include <iostream>
#include <locale>
#include <stdexcept>

int main ()
{
    std::locale loc;

    try
    {
        loc = std::locale ("en_US.UTF8");
    }
    catch (std::runtime_error)
    {
        loc = std::locale (loc, "", std::locale::ctype);
    }

    std::cout << "Selected locale is: " << loc.name() << '\n';

    return 0;
}
