diff --git a/lib/Slic3r/Config.pm b/lib/Slic3r/Config.pm index 022c206f1..366c96f2c 100644 --- a/lib/Slic3r/Config.pm +++ b/lib/Slic3r/Config.pm @@ -89,10 +89,17 @@ sub load { # legacy syntax of load() my $config = $class->new; - $config->_load($file); + $config->_load(Slic3r::encode_path($file)); return $config; } +sub save { + my $self = shift; + my ($file) = @_; + + return $self->_save(Slic3r::encode_path($file)); +} + sub load_ini_hash { my $class = shift; my ($ini_hash) = @_; diff --git a/xs/xsp/Config.xsp b/xs/xsp/Config.xsp index 4bc608191..496269a73 100644 --- a/xs/xsp/Config.xsp +++ b/xs/xsp/Config.xsp @@ -39,7 +39,7 @@ %name{setenv} void setenv_(); double min_object_distance(); %name{_load} void load(std::string file); - void save(std::string file); + %name{_save} void save(std::string file); }; %name{Slic3r::Config::Static} class StaticPrintConfig { @@ -87,7 +87,7 @@ %name{setenv} void setenv_(); double min_object_distance(); %name{_load} void load(std::string file); - void save(std::string file); + %name{_save} void save(std::string file); }; %package{Slic3r::Config}; diff --git a/xs/xsp/my.map b/xs/xsp/my.map index 43848e3d6..5f87f51c2 100644 --- a/xs/xsp/my.map +++ b/xs/xsp/my.map @@ -254,7 +254,7 @@ INPUT T_STD_STRING { size_t len; - const char * c = SvPVutf8($arg, len); + const char * c = SvPV($arg, len); $var = std::string(c, len); }