Minor note: I think std::locale::classic() is more efficient.