equal
deleted
inserted
replaced
|
1 #!/bin/csh -f |
|
2 # |
|
3 # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. |
|
4 # |
|
5 |
|
6 set path=( $path /usr/bin /usr/sbin /bin ) |
|
7 |
|
8 set UCONV=uconv |
|
9 |
|
10 set CONVS="1252 CN-Big5 cns11643_1 cp949c Cp949c csUnicode11 csUnicode11UTF7 csUnicodeASCII csUnicodeLatin1 csWindows31Latin5 IMAP-MODIFIED-UTF-7 IMAP_UTF_7 IMAP-UTF-7 ISO-10646 ISO-10646-J-1 ISO-10646-UCS-BASIC ISO-10646-Unicode-Latin1 iso-8859-11 iso_8859-1:1978 ISO-8859-1-Windows-3.0-Latin-1 ISO-8859-1-Windows-3.1-Latin-1 ISO-8859-2-Windows-Latin-2 iso-8859-5-windows-latin-5 ISO-8859-8-Visual MODIFIED_UTF_7 MODIFIED-UTF-7 MUTF_7 MUTF-7 UNICODE-1-1-URF-7 UNICODE-1-1-UTF-7 UNICODE-1-1-UTF-8 unicode-2-0-utf-8 visual x-cp1250 x-cp1251 x-cp1252 x-cp1253 x-cp1254 x-cp1255 x-cp1256 x-cp1257 x-cp1258 x-euc x-ms-cp932 x-x-big5 x-gbk iso-8859-8i Win1255 Big5-HKSCS EUC-TW 5601 ansi-1251 TIS620.2533 x-johab johap x-johap x-euc-tw x-windows-949 iso-8859-13" |
|
11 |
|
12 set LOGFILE=conversion-test-SunOS.log |
|
13 set TMPFILE=tmpfile$$.txt |
|
14 |
|
15 |
|
16 /bin/rm -fr $LOGFILE |
|
17 |
|
18 @ okay = 1 |
|
19 foreach i ( $CONVS ) |
|
20 echo "Testing $i conversion:" |& tee -a $LOGFILE |
|
21 $UCONV -f us-ascii -t $i /etc/passwd | $UCONV -f $i -t us-ascii >! $TMPFILE |
|
22 diff -c /etc/passwd $TMPFILE >> /dev/null |
|
23 if ( $status == 1) then |
|
24 echo " roundtrip conversion failed..." |& tee -a $LOGFILE |
|
25 @ okay = 0 |
|
26 else |
|
27 echo " roundtrip conversion successful." |& tee -a $LOGFILE |
|
28 endif |
|
29 end |
|
30 |
|
31 /bin/rm -fr $TMPFILE |
|
32 |
|
33 if ( $okay == 0 ) then |
|
34 printf "\nWarning: conversion error happened. Check the log file.\n" |
|
35 echo "Conversion test done; test log has been created as ./${LOGFILE}." |
|
36 exit 1 |
|
37 endif |
|
38 |
|
39 echo "Conversion test done; test log has been created as ./${LOGFILE}." |
|
40 |
|
41 exit 0 |