Hi, Indeed, it's important to do so when utf8 encoded text is going to be written to a filehandle. For example, when extracting data from an utf8 database like MySQL and writing it to a file, or when reading from an utf8 encoded file.
" To mark FILEHANDLE as UTF-8, use :utf8 or :encoding(utf8) . :utf8 just marks the data as UTF-8 without further checking, while :encoding(utf8) checks the data for actually being valid UTF-8. More details can be found in PerlIO::encoding. " This quote from the binmode perldoc suggests that one must take good care about what is written to the filehandle when the ":uft8" layer is used. It it's not well formed uft-8, the result might end up in something unexpected. Sébastien > -----Message d'origine----- > De : [email protected] > [mailto:[email protected]] De la part de Rick > Welykochy > Envoyé : 14 décembre 2008 14:52 > À : [email protected] > Objet : [Koha-devel] binmode in pler scripts for utf-8 support > > Hi all, > > I ran across this bit of randomness today: > > binmode STDOUT, ":utf8"; > > It occurs in only three perl scripts in Koha: > > ./circ/ysearch.pl > ./misc/sax_parser_test.pl > ./reports/guided_reports.pl > > Should this binmode setting be executed in all of our perl > scripts to provide correct utf-8 support? > > If not, why not? > > > cheers > rickw > > > > -- > _________________________________ > Rick Welykochy || Praxis Services > > We are ready for any unforeseen event that may or may not occur. > -- Al Gore, Vice President > _______________________________________________ > Koha-devel mailing list > [email protected] > http://lists.koha.org/mailman/listinfo/koha-devel > _______________________________________________ Koha-devel mailing list [email protected] http://lists.koha.org/mailman/listinfo/koha-devel
