summaryrefslogtreecommitdiff
path: root/apt-pkg/install-progress.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-08-23 20:19:11 +0200
committerJulian Andres Klode <jak@debian.org>2016-08-26 22:17:13 +0200
commit0fb16c3e678044d6d06ba8a6199b1e96487ee0d8 (patch)
tree5d420b3f7e4d5b5e48699e1c34a0be6dd12269f9 /apt-pkg/install-progress.cc
parentcede4eda68220a002822194605d436b7ca044afa (diff)
Use C locale instead of C.UTF-8 for protocol strings
The C.UTF-8 locale is not portable, so we need to use C, otherwise we crash on other systems. We can use std::locale::classic() for that, which might also be a bit cheaper than using locale("C").
Diffstat (limited to 'apt-pkg/install-progress.cc')
-rw-r--r--apt-pkg/install-progress.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index 256495420..6c3e51b2c 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -84,7 +84,7 @@ static std::string GetProgressFdString(char const * const status,
{
float const progress{Done / static_cast<float>(Total) * 100};
std::ostringstream str;
- str.imbue(std::locale("C.UTF-8"));
+ str.imbue(std::locale::classic());
str.precision(4);
str << status << ':' << pkg << ':' << std::fixed << progress << ':' << msg << '\n';
return str.str();
@@ -165,7 +165,7 @@ static std::string GetProgressDeb822String(char const * const status,
{
float const progress{Done / static_cast<float>(Total) * 100};
std::ostringstream str;
- str.imbue(std::locale("C.UTF-8"));
+ str.imbue(std::locale::classic());
str.precision(4);
str << "Status: " << status << '\n';
if (pkg != nullptr)