#! /bin/sh
#!perl -w # --*- Perl -*--
eval 'exec perl -x $0 ${1+"$@"}'
    if 0;
#------------------------------------------------------------------------------
#$Author: antanas $
#$Date: 2021-04-28 19:35:53 +0300 (Wed, 28 Apr 2021) $
#$Revision: 8738 $
#$URL: svn+ssh://www.crystallography.net/home/coder/svn-repositories/cod-tools/tags/v3.2.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 qw( get_version_string );

#* 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 get_version_string(), "\n"; exit }
);

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

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

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