[Bins] Re: outputs Copyright information as Latin-1 even on UTF-8 terminals

Martin Michlmayr tbm at cyrius.com
Fri Nov 4 21:04:06 GMT 2005


tags 308111 + patch
thanks

* Martin Michlmayr <tbm at cyrius.com> [2005-05-08 00:00]:
> When bins prints its copyright message, the (C) sign (©) cannot be
> read and the name "Jérôme Sautret" is garbled too.  This is because
> the string is printed in Latin-1 even though I'm using a UTF-8 locale.

Don Armstrong submitted the following patch for this problem.  It
works for me.


--- bins-1.1.29.orig/bins
+++ bins-1.1.29/bins
@@ -86,6 +86,10 @@
 #use Data::Dumper;
 #use XML::SAX::Expat;
 
+# Encoding Handling
+use Encode;
+use open ':locale';
+
 sub have_package;
 sub _; # alias for Getext, if present
 
@@ -952,13 +956,19 @@
 
 sub write_htaccess;
 
-print "\nBINS Photo Album 1.1.29 (http://bins.sautret.org/)\n";
-print "Copyright © 2001-2004 Jérôme Sautret (Jerome\@Sautret.org)\n";
-print "Some parts of code:\n";
-print "Copyright © 2000 Brendan McMahan (mcmahahb\@whitman.edu)\n";
-print "Copyright ©      John Moose (moosejc\@muohio.edu)\n\n";
-print "This is free software with ABSOLUTELY NO WARRANTY.\n";
-print "See COPYING file for details.\n\n";
+my $copyright=<<END;
+\nBINS Photo Album 1.1.29 (http://bins.sautret.org/)
+Copyright © 2001-2004 Jérôme Sautret (Jerome\@Sautret.org)
+Some parts of the code:
+Copyright © 2000 Brendan McMahan (mcmahahb\@whitman.edu)
+Copyright ©      John Moose (moosejc\@muohio.edu)
+
+This is free software with ABSOLUTELY NO WARRANTY.
+See COPYING file for details.
+
+END
+$copyright = decode('iso8859-1',$copyright);
+print $copyright;
 
 # EVG (Evil Global Variables)
 # Some on them should be moved to the config hash so they can be

-- 
Martin Michlmayr
http://www.cyrius.com/


More information about the Bins mailing list