2 # Copyright (C) 2016 and later: Unicode, Inc. and others.
3 # License & terms of use: http://www.unicode.org/copyright.html
4 # Copyright (C) 2000-2011, International Business Machines
5 # Corporation and others. All Rights Reserved.
15 # This script detects if any UTF-8 files were incorrectly converted to EBCDIC, and
18 if [ -z "$QSH_VERSION" ];
21 echo "QSH not detected (QSH_VERSION not set) - just testing."
24 #echo "QSH version $QSH_VERSION"
30 echo "Determining binary files by BOM ..."
35 for file in `find ./icu/source/data/unidata \( -name \*.txt -print \)`; do
36 bom8=`od -t x1 -N 3 $file|\
39 #Find a converted UTF-8 BOM
40 echo "file $file bom /${bom8}/"
41 if [ "$bom8" = "57 8b ab" ]
43 file="`echo $file | cut -d / -f2-`"
44 echo "converting ${file}"
45 if [ `echo $binary_files | wc -w` -lt 200 ]
47 bin_count=`expr $bin_count + 1`
48 binary_files="$binary_files $file";
50 echo "Restoring binary files by BOM ($bin_count)..."
52 pax -C 819 -rvf $tar_file $binary_files;
53 echo "Determining binary files by BOM ($bin_count)..."
55 bin_count=`expr $bin_count + 1`
59 if [ `echo $binary_files | wc -w` -gt 0 ]
63 pax -C 819 -rvf $tar_file $binary_files