Re: Charset guessing & translation for the viewer



Correction: in order to correctly handle filenames with spaces in them, the myfile script should be:

STANDARDFILE=`/usr/bin/file -b $1 "$2"`
if echo $STANDARDFILE | grep text > /dev/null;
then
   echo $2: `enca -r "$2" 2> /dev/null` text;
else
   echo $2: $STANDARDFILE;
fi

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]