From 4de8f0118e1baf31cf4c859881dfbf39014b566f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 11 May 2014 23:59:19 +0100 Subject: Use raw_convert instead of boost::lexical_cast as it seems that lexical_cast will sometimes use a thousands separator (i.e. it will convert 1234 to a string 1,234). It appears not to be possible safely to turn this off (you have to set the global locale). Instead, raw_convert uses a stringstream which you can imbue() with std::locale::classic() to turn off the locale-specific behaviour. --- src/cpl.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/cpl.cc') diff --git a/src/cpl.cc b/src/cpl.cc index e333df0d..5079b4f6 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2013 Carl Hetherington + Copyright (C) 2012-2014 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,6 +31,7 @@ #include "signer.h" #include "exceptions.h" #include "compose.hpp" +#include "raw_convert.h" using std::string; using std::stringstream; @@ -248,7 +249,7 @@ CPL::write_to_pkl (xmlpp::Node* node, bool interop) const xmlpp::Node* asset = node->add_child ("Asset"); asset->add_child("Id")->add_child_text ("urn:uuid:" + _id); asset->add_child("Hash")->add_child_text (_digest); - asset->add_child("Size")->add_child_text (lexical_cast (_length)); + asset->add_child("Size")->add_child_text (raw_convert (_length)); if (interop) { asset->add_child("Type")->add_child_text ("text/xml;asdcpKind=CPL"); } else { @@ -285,7 +286,7 @@ CPL::write_to_assetmap (xmlpp::Node* node) const chunk->add_child("Path")->add_child_text (_id + "_cpl.xml"); chunk->add_child("VolumeIndex")->add_child_text ("1"); chunk->add_child("Offset")->add_child_text("0"); - chunk->add_child("Length")->add_child_text(lexical_cast (_length)); + chunk->add_child("Length")->add_child_text (raw_convert (_length)); } -- cgit v1.2.3