From: Lukas Mai Date: Sun, 2 Oct 2011 12:07:57 +0000 (+0200) Subject: binmode STDOUT to not generate garbage in a UTF-8 environment (bug #71399) X-Git-Tag: v0.11011~76 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a1afcdb64df0c39f15e27dfb561d217f39235234;p=dbsrgits%2FSQL-Translator.git binmode STDOUT to not generate garbage in a UTF-8 environment (bug #71399) --- diff --git a/script/sqlt-diagram b/script/sqlt-diagram index 8a9bf6f..ca58dc6 100755 --- a/script/sqlt-diagram +++ b/script/sqlt-diagram @@ -1,7 +1,7 @@ #!/usr/bin/env perl # ------------------------------------------------------------------- -# Copyright (C) 2002-2009 SQLFairy Authors +# Copyright (C) 2002-2011 SQLFairy Authors # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -136,6 +136,8 @@ my $translator = SQL::Translator->new( }, ) or die SQL::Translator->error; +binmode STDOUT unless $out_file; + for my $file (@files) { my $output = $translator->translate( $file ) or die "Error: " . $translator->error;