gen-test-files.sh - clic - Clic is an command line interactive client for gopher written in Common LISP
 (HTM) git clone git://bitreich.org/clic/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/clic/
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Tags
 (DIR) README
 (DIR) LICENSE
       ---
       gen-test-files.sh (1534B)
       ---
            1 #!/bin/sh
            2 # -*- indent-tabs-mode: nil -*-
            3 #
            4 # gen-test-files.sh --- Generates test files with iconv.
            5 #
            6 # Copyright (C) 2007, Luis Oliveira  <loliveira@common-lisp.net>
            7 #
            8 # Permission is hereby granted, free of charge, to any person
            9 # obtaining a copy of this software and associated documentation
           10 # files (the "Software"), to deal in the Software without
           11 # restriction, including without limitation the rights to use, copy,
           12 # modify, merge, publish, distribute, sublicense, and/or sell copies
           13 # of the Software, and to permit persons to whom the Software is
           14 # furnished to do so, subject to the following conditions:
           15 #
           16 # The above copyright notice and this permission notice shall be
           17 # included in all copies or substantial portions of the Software.
           18 #
           19 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
           20 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
           21 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
           22 # NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
           23 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
           24 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
           25 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
           26 # DEALINGS IN THE SOFTWARE.
           27 
           28 INPUT_FILE="utf-8.txt"
           29 INPUT_ENC="utf-8"
           30 CHARSETS=('ebcdic-us' 'ascii' 'iso-8859-1' 'utf-16' 'utf-32')
           31 
           32 echo "Converting $INPUT_FILE..."
           33 for c in ${CHARSETS[@]}; do
           34     echo "  ${c}.txt";
           35     iconv -c -f $INPUT_ENC -t $c $INPUT_FILE > ${c}.txt;
           36     iconv -f $c -t 'utf-8' ${c}.txt > ${c}.txt-utf8;
           37 done