From: Don Armstrong <don@donarmstrong.com>
Date: Tue, 12 Mar 2013 20:47:32 +0000 (-0700)
Subject: switch STDOUT to raw first, then use encoding(UTF-8)
X-Git-Tag: release/2.6.0~313^2~8
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=37fa4f5e9b7218b8a909f2c0502a12c6b7f5303e;p=debbugs.git

switch STDOUT to raw first, then use encoding(UTF-8)
---

diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi
index 55617ae1..70f42292 100755
--- a/cgi/bugreport.cgi
+++ b/cgi/bugreport.cgi
@@ -8,8 +8,6 @@ BEGIN{
     delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
 }
 
-# STDOUT should be using the utf8 io layer
-binmode(STDOUT,':utf8');
 
 use POSIX qw(strftime);
 use MIME::Parser;
@@ -38,6 +36,8 @@ use List::Util qw(max);
 
 use CGI::Simple;
 my $q = new CGI::Simple;
+# STDOUT should be using the utf8 io layer
+binmode(STDOUT,':raw:encoding(UTF-8)');
 
 my %param = cgi_parameters(query => $q,
 			   single => [qw(bug msg att boring terse),
diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi
index d29c3abc..eb7a61a2 100755
--- a/cgi/pkgreport.cgi
+++ b/cgi/pkgreport.cgi
@@ -18,9 +18,7 @@ BEGIN{
     delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
 }
 
-# STDOUT should be in utf8 mode
-binmode(STDOUT,':utf8');
-
+binmode(STDOUT,':encoding(UTF-8)');
 use POSIX qw(strftime nice);
 
 use Debbugs::Config qw(:globals :text :config);