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/parse/subtitle.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/parse') diff --git a/src/parse/subtitle.cc b/src/parse/subtitle.cc index 914be677..a4b0410a 100644 --- a/src/parse/subtitle.cc +++ b/src/parse/subtitle.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 @@ -20,6 +20,7 @@ #include #include #include "subtitle.h" +#include "../raw_convert.h" #include "../types.h" using std::string; @@ -114,7 +115,7 @@ Subtitle::fade_time (shared_ptr node, string name) } else if (u.find (":") != string::npos) { t = Time (u); } else { - t = Time (0, 0, 0, lexical_cast (u)); + t = Time (0, 0, 0, raw_convert (u)); } if (t > Time (0, 0, 8, 0)) { -- cgit v1.2.3