From b4ac63d7499305ab381ed2ab7c03d8a978d9ec61 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 24 Mar 2014 17:52:50 +0100 Subject: [PATCH] Error in previous commit: Bugfix: prevent crash when user entered Unicode characters in notes. #1590 --- lib/Slic3r/Print.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 67aa3759f5..f63dca4631 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -793,10 +793,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;