File: cif-to-utf8

package info (click to toggle)
cod-tools 3.1.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 149,700 kB
  • sloc: perl: 56,946; sh: 32,158; ansic: 6,385; xml: 1,982; yacc: 1,117; makefile: 728; python: 166
file content (45 lines) | stat: -rwxr-xr-x 1,300 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /bin/sh
#!perl -w # --*- Perl -*--
eval 'exec perl -x $0 ${1+"$@"}'
    if 0;
#------------------------------------------------------------------------------
#$Author: antanas $
#$Date: 2019-11-18 11:08:55 +0200 (Mon, 18 Nov 2019) $ 
#$Revision: 7429 $
#$URL: svn+ssh://www.crystallography.net/home/coder/svn-repositories/cod-tools/tags/v3.1.0/scripts/cif-to-utf8 $
#------------------------------------------------------------------------------
#*
#* Convert CIF escape sequences into Unicode characters.
#*
#* USAGE:
#*    $0 input1.cif input*.cif
#**

use strict;
use warnings;
use COD::CIF::Unicode2CIF qw( cif2unicode );
use COD::SOptions qw( getOptions );
use COD::SUsage qw( usage );
use COD::ToolsVersion;

#* OPTIONS:
#*   --help, --usage
#*                     Output a short usage message (this message) and exit.
#*   --version
#*                     Output version information and exit.
#**
@ARGV = getOptions(
    "--help,--usage"    => sub { usage; exit },
    '--version'         => sub { print 'cod-tools version ',
                                 $COD::ToolsVersion::Version, "\n";
                                 exit }
);

use open ":encoding(UTF-8)";

binmode( STDIN,  ":encoding(UTF-8)" );
binmode( STDOUT, ":encoding(UTF-8)" );

while(<>) {
    print cif2unicode( $_ );
}