text_serializer.cc-> Serialize api is still not fully locale independent even after temporarily switching the locale config of the ostream. The double values still react to the global locale settings as the library is using std::snprintf to convert double to char array before writing it to the ostream. this method call is not affected by what locale is set to be used by ostream. I have attached a diff which achieves same formatting of double as snprintf's "%.*g", std::numeric_limits::max_digits10 - 1
Please find the attached patch that we used for this fix: locale-0.12.3.patch.zip