]> git.sesse.net Git - mlt/commitdiff
If LC_NUMERIC unsupported on OS, serialize XML with LC_NUMERIC=C.
authorDan Dennedy <dan@dennedy.org>
Sat, 1 Feb 2014 05:39:47 +0000 (21:39 -0800)
committerDan Dennedy <dan@dennedy.org>
Sat, 1 Feb 2014 05:39:47 +0000 (21:39 -0800)
src/modules/xml/consumer_xml.c

index f90759c88e4a47dd89282d09c48e0143c698f39c..4fa0904ba12e47fc188c0700a945b08ec32b8c95 100644 (file)
@@ -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 );
 }