From cfddde98f6390ac49841c764107278e7a3a8b0c4 Mon Sep 17 00:00:00 2001 From: Karlson2k Date: Thu, 5 Feb 2015 22:30:30 +0300 Subject: [PATCH] JSONVariantWriter::Write(): do no re-set locale if locale is already "C" --- xbmc/utils/JSONVariantWriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xbmc/utils/JSONVariantWriter.cpp b/xbmc/utils/JSONVariantWriter.cpp index 61fdd4cb173ca..43ddcea46d78b 100644 --- a/xbmc/utils/JSONVariantWriter.cpp +++ b/xbmc/utils/JSONVariantWriter.cpp @@ -35,7 +35,7 @@ string CJSONVariantWriter::Write(const CVariant &value, bool compact) // Set locale to classic ("C") to ensure valid JSON numbers const char *currentLocale = setlocale(LC_NUMERIC, NULL); std::string backupLocale; - if (currentLocale != NULL) + if (currentLocale != NULL && (currentLocale[0] != 'C' || currentLocale[1] != 0)) { backupLocale = currentLocale; setlocale(LC_NUMERIC, "C");