You can use a std::istream and call imbue.
I am using this approach now in netlist. Also removing all c library stuff and moving to c++ library.
Another detail on the UI toolkit: The toolkit only changes the C library locale (setlocale). The c++ locale reports "C" on a call to locale().
So c++ functions use the "C" locale and c functions (stod and friends, printf ...) use the system locale when running on OSX.