Hopefully fix all problems with non-ASCII paths on Windows

This commit is contained in:
Alessandro Ranellucci 2015-03-09 15:17:50 +01:00
parent 66824fd17e
commit 6185f45815
7 changed files with 24 additions and 21 deletions

View file

@ -32,8 +32,6 @@ warn "Running Slic3r under Perl 5.16 is not supported nor recommended\n"
use FindBin;
our $var = "$FindBin::Bin/var";
use Encode;
use Encode::Locale;
use Moo 1.003001;
use Slic3r::XS; # import all symbols (constants etc.) before they get parsed
@ -261,13 +259,17 @@ sub resume_all_threads {
}
sub encode_path {
my ($filename) = @_;
return encode('locale_fs', $filename);
my ($path) = @_;
utf8::downgrade($path) if $^O eq 'MSWin32';
return $path;
}
sub decode_path {
my ($filename) = @_;
return decode('locale_fs', $filename);
my ($path) = @_;
utf8::upgrade($path) if $^O eq 'MSWin32';
return $path;
}
sub open {