On Thu, Dec 10, 2009 at 10:01 AM, stan <st...@panix.com> wrote:
> BTW I copied the logfile.txt to one of my *NIX machines, and I was ging to
> send t, but it seems to not be a text file. What;s the storry here?

Windows "text" = UTF-16 with some kind of non-unicode encoding. It's
an ASCII superset, to it's usually reasonably processable by something
that can convert UTF-16 to UTF-8.

Here's the script I use to read ZWC logfiles from their CABs (although
I complain so loudly while doing so that I'm rarely asked to look at
such problems anymore .. sometimes being the squeaky wheel gets you
left alone!).  Note that not all of the utf-16->utf-8 conversions
work, due to .. some windows stupidity I'm sure.

echo "** Extracting CAB"
cabextract -d "$dirname" "$cabfile" || exit 1

echo "** Fixing text files"
for i in $(find . -name '*.txt'); do
    if ! iconv -f utf-16 -t utf-8 $i > $i.utf8; then
        echo "skipping $i"
        rm -f $i.utf8
        continue
    fi
    mv $i.utf8 $i || exit 1
    dos2unix $i
done

Dustin

-- 
Open Source Storage Engineer
http://www.zmanda.com

Reply via email to