From 33738ff3fea51c8c6b292944cef15d89845764ef Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Fri, 31 Jan 2014 21:39:47 -0800 Subject: [PATCH] If LC_NUMERIC unsupported on OS, serialize XML with LC_NUMERIC=C. --- src/modules/xml/consumer_xml.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/xml/consumer_xml.c b/src/modules/xml/consumer_xml.c index f90759c8..4fa0904b 100644 --- a/src/modules/xml/consumer_xml.c +++ b/src/modules/xml/consumer_xml.c @@ -842,6 +842,12 @@ static void output_xml( mlt_consumer this ) free( cwd ); } +#if !defined(__linux__) && !defined(__DARWIN__) + // Get the current locale + char *orig_localename = strdup( setlocale( LC_NUMERIC, NULL ) ); + setlocale( LC_NUMERIC, "C" ); +#endif + // Make the document doc = xml_make_doc( this, service ); @@ -867,6 +873,12 @@ static void output_xml( mlt_consumer this ) xmlSaveFormatFileEnc( resource, doc, "utf-8", 1 ); } +#if !defined(__linux__) && !defined(__DARWIN__) + // Restore the current locale + setlocale( LC_NUMERIC, orig_localename ); + free( orig_localename ); +#endif + // Close the document xmlFreeDoc( doc ); } -- 2.39.2