mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 22:54:08 -06:00
Bugfix: crash when reading/writing files to paths containing non-ASCII characters on Windows. #651 #865
This commit is contained in:
parent
73aae07e74
commit
ad9be0e4d7
8 changed files with 20 additions and 11 deletions
|
@ -946,7 +946,7 @@ sub new_from_cli {
|
|||
if ($args{$opt_key}) {
|
||||
die "Invalid value for --${_}-gcode: file does not exist\n"
|
||||
if !-e $args{$opt_key};
|
||||
open my $fh, "<", $args{$opt_key}
|
||||
Slic3r::open(\my $fh, "<", $args{$opt_key})
|
||||
or die "Failed to open $args{$opt_key}\n";
|
||||
binmode $fh, ':utf8';
|
||||
$args{$opt_key} = do { local $/; <$fh> };
|
||||
|
@ -1251,7 +1251,7 @@ sub write_ini {
|
|||
my $class = shift;
|
||||
my ($file, $ini) = @_;
|
||||
|
||||
open my $fh, '>', $file;
|
||||
Slic3r::open(\my $fh, '>', $file);
|
||||
binmode $fh, ':utf8';
|
||||
my $localtime = localtime;
|
||||
printf $fh "# generated by Slic3r $Slic3r::VERSION on %s\n", "$localtime";
|
||||
|
@ -1269,7 +1269,7 @@ sub read_ini {
|
|||
my ($file) = @_;
|
||||
|
||||
local $/ = "\n";
|
||||
open my $fh, '<', $file;
|
||||
Slic3r::open(\my $fh, '<', $file);
|
||||
binmode $fh, ':utf8';
|
||||
|
||||
my $ini = { _ => {} };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue