From 66e48e9d225bfe433eb9c11cc871771e99cf747c Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 28 Aug 2016 11:23:06 +0200 Subject: [PATCH] Revert "More fixes for non-ASCII paths on Windows" This reverts commit e79eac2671fca060a04d8183e97b655523eafdfb. --- .travis.yml | 1 - xs/Build.PL | 2 +- xs/src/libslic3r/Config.cpp | 27 ++++++--------------------- 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index a9cd3167f..f25d6bcbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,4 +20,3 @@ addons: - libboost-thread1.55-dev - libboost-system1.55-dev - libboost-filesystem1.55-dev - - libboost-locale1.55-dev diff --git a/xs/Build.PL b/xs/Build.PL index 6d4342bf1..8a111c1a4 100644 --- a/xs/Build.PL +++ b/xs/Build.PL @@ -47,7 +47,7 @@ if (defined $ENV{BOOST_DIR}) { # In order to generate the -l switches we need to know how Boost libraries are named my $have_boost = 0; -my @boost_libraries = qw(system thread filesystem locale); # we need these +my @boost_libraries = qw(system thread filesystem); # we need these # check without explicit lib path (works on Linux) $have_boost = 1 diff --git a/xs/src/libslic3r/Config.cpp b/xs/src/libslic3r/Config.cpp index b76550a09..372b7b1b0 100644 --- a/xs/src/libslic3r/Config.cpp +++ b/xs/src/libslic3r/Config.cpp @@ -4,14 +4,10 @@ #include #include #include -#include #include // std::runtime_error #include #include -#include -#include #include -#include #include #include @@ -218,32 +214,21 @@ ConfigBase::load(const std::string &file) void ConfigBase::save(const std::string &file) const { - // Get the default locale - std::locale loc = boost::locale::generator().generate(""); + using namespace std; + ofstream c; + c.open(file.c_str(), ios::out | ios::trunc); - // Set the global locale to loc - std::locale::global(loc); - - // Make boost.filesystem use it by default - boost::filesystem::path::imbue(std::locale()); - - // Create the path (file is assumed to be be utf-8) - boost::filesystem::path path(file); - - boost::filesystem::ofstream c; - c.open(path, std::ios::out | std::ios::trunc); - { time_t now; time(&now); char buf[sizeof "0000-00-00 00:00:00"]; strftime(buf, sizeof buf, "%F %T", gmtime(&now)); - c << "# generated by Slic3r " << SLIC3R_VERSION << " on " << buf << std::endl; + c << "# generated by Slic3r " << SLIC3R_VERSION << " on " << buf << endl; } - + t_config_option_keys my_keys = this->keys(); for (t_config_option_keys::const_iterator opt_key = my_keys.begin(); opt_key != my_keys.end(); ++opt_key) - c << *opt_key << " = " << this->serialize(*opt_key) << std::endl; + c << *opt_key << " = " << this->serialize(*opt_key) << endl; c.close(); }