I'm writing a simple c++ interface to gnuplot for a Qt application. Numeric and date-time user data is locale-aware, so it could be "1234.567", "1,234", "1.234,567" or whatever Qt supports. Gnuplot offers decimalsign option, and it also works, but I don't know a way how to convert Qt locale name to gnuplot locale name. For example, Qt locale name returns ru_RU
and gnuplot show locale
returns
gnuplot LC_CTYPE Russian_Russia.1251
gnuplot encoding cp1251
gnuplot LC_TIME Russian_Russia.1251
gnuplot LC_NUMERIC C
There are an unaswered question about locales and (probably outdated) related question.
I'm aware of gnuplot-iostreams, but is seems to me that the library itself does not enforce any locale, so it will not work either if locales in Qt and gnuplot are mismatched.
Is there any cross-platform way (Windows, Unix, MacOS) to convert Qt locale name to gnuplot locale name? Or may be there is a better way to handle all of this?
Thank you.