From 2a52a318fe9ae37b0844a25a37ea03825142bc80 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 24 Mar 2014 17:02:25 +0100 Subject: [PATCH] Error in previous commit: Bugfix: prevent crash when user entered Unicode characters in notes. #1590 --- lib/Slic3r/Print.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 15851badc9..094b095189 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -702,11 +702,11 @@ sub write_gcode { } else { Slic3r::open(\$fh, ">", $file) or die "Failed to open $file for writing\n"; + + # enable UTF-8 output since user might have entered Unicode characters in fields like notes + binmode $fh, ':utf8'; } - # enable UTF-8 output since user might have entered Unicode characters in fields like notes - binmode $fh, ':utf8'; - # write some information my @lt = localtime; printf $fh "; generated by Slic3r $Slic3r::VERSION on %04d-%02d-%02d at %02d:%02d:%02d\n\n",