mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-13 17:01:49 +08:00
Revert "More fixes for non-ASCII paths on Windows"
This reverts commit e79eac2671fca060a04d8183e97b655523eafdfb.
This commit is contained in:
parent
1532f54350
commit
66e48e9d22
@ -20,4 +20,3 @@ addons:
|
|||||||
- libboost-thread1.55-dev
|
- libboost-thread1.55-dev
|
||||||
- libboost-system1.55-dev
|
- libboost-system1.55-dev
|
||||||
- libboost-filesystem1.55-dev
|
- libboost-filesystem1.55-dev
|
||||||
- libboost-locale1.55-dev
|
|
||||||
|
@ -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
|
# In order to generate the -l switches we need to know how Boost libraries are named
|
||||||
my $have_boost = 0;
|
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)
|
# check without explicit lib path (works on Linux)
|
||||||
$have_boost = 1
|
$have_boost = 1
|
||||||
|
@ -4,14 +4,10 @@
|
|||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <locale>
|
|
||||||
#include <exception> // std::runtime_error
|
#include <exception> // std::runtime_error
|
||||||
#include <boost/algorithm/string/erase.hpp>
|
#include <boost/algorithm/string/erase.hpp>
|
||||||
#include <boost/algorithm/string/predicate.hpp>
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
#include <boost/filesystem/fstream.hpp>
|
|
||||||
#include <boost/filesystem/path.hpp>
|
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/locale.hpp>
|
|
||||||
#include <boost/property_tree/ini_parser.hpp>
|
#include <boost/property_tree/ini_parser.hpp>
|
||||||
#include <boost/property_tree/ptree.hpp>
|
#include <boost/property_tree/ptree.hpp>
|
||||||
|
|
||||||
@ -218,32 +214,21 @@ ConfigBase::load(const std::string &file)
|
|||||||
void
|
void
|
||||||
ConfigBase::save(const std::string &file) const
|
ConfigBase::save(const std::string &file) const
|
||||||
{
|
{
|
||||||
// Get the default locale
|
using namespace std;
|
||||||
std::locale loc = boost::locale::generator().generate("");
|
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_t now;
|
||||||
time(&now);
|
time(&now);
|
||||||
char buf[sizeof "0000-00-00 00:00:00"];
|
char buf[sizeof "0000-00-00 00:00:00"];
|
||||||
strftime(buf, sizeof buf, "%F %T", gmtime(&now));
|
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();
|
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)
|
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();
|
c.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user