xmltv/filter tv_cat,1.18,1.19

Geoff <[email protected]>
Newsgroups gmane.comp.tv.xmltv.cvs
Message-ID <[email protected]>
Update of /cvsroot/xmltv/xmltv/filter
In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv4107

Modified Files:
	tv_cat 
Log Message:
add option to merge files with different encodings (output = utf-8) (Bug #144)

Index: tv_cat
===================================================================
RCS file: /cvsroot/xmltv/xmltv/filter/tv_cat,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** tv_cat	25 Oct 2003 09:59:27 -0000	1.18
--- tv_cat	19 Apr 2014 08:44:50 -0000	1.19
***************
*** 9,13 ****
  =head1 SYNOPSIS
  
! tv_cat [--help] [--output FILE] [FILE...]
  
  =head1 DESCRIPTION
--- 9,13 ----
  =head1 SYNOPSIS
  
! tv_cat [--help] [--utf8] [--output FILE] [FILE...]
  
  =head1 DESCRIPTION
***************
*** 31,34 ****
--- 31,42 ----
  recoding or other processing) and tv_cat die with an error message.
  
+ But if you do want to combine multiple input files with different
+ character encodings then you can use the --utf8 command-line parameter
+ which will create a combined output file in UTF-8 format. (Note: it is 
+ not safe to combine mixed encodings to anything other than UTF-8 so no
+ other output encoding is provided for.) (Note 2: any input file which 
+ does not have an encoding specified in the xml tag is not only naughty 
+ but is assumed to already be UTF-8, which may not be true!)
+ 
  This tool is rather useless, but it makes a good testbed for the XMLTV
  module.
***************
*** 64,74 ****
  use XMLTV;
  use XMLTV::Usage <<END
! $0: concatenate listings, merging channels
! usage: $0 [--help] [--output FILE] [FILE...]
  END
  ;
  
! my ($opt_help, $opt_output);
! GetOptions('help' => \$opt_help, 'output=s' => \$opt_output) or usage(0);
  usage(1) if $opt_help;
  @ARGV = ('-') if not @ARGV;
--- 72,82 ----
  use XMLTV;
  use XMLTV::Usage <<END
! $0: concatenate listings, merging channels, (optional: utf-8 output file)
! usage: $0 [--help] [--utf8] [--output FILE] [FILE...]
  END
  ;
  
! my ($opt_help, $opt_output, $opt_utf8);
! GetOptions('help' => \$opt_help, 'output=s' => \$opt_output, 'utf8' => \$opt_utf8) or usage(0);
  usage(1) if $opt_help;
  @ARGV = ('-') if not @ARGV;
***************
*** 81,83 ****
--- 89,95 ----
  }
  
+ if (defined $opt_utf8) {
+     $w_args{'UTF8'} = 1;
+ }
+ 
  XMLTV::catfiles(\%w_args, @ARGV);


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.