in reply to Re^2: script inserts \x00 bytes on WinXP
in thread script inserts \x00 bytes on WinXP

the output file contains one huge line of

\x{4445}\x{3035}\x{533b}\x{676f}\x{203b}\x{2e34}\x{4e37}\x{6475}\x{736f}\x{203b}\x{6f43}

Seriously, an "od -c" of the output file shows this:

0000000 \ x { 7 6 4 5 } \ x { 6 e 6 5 + } 0000020 \ x { 6 f 7 4 } \ x { 4 2 2 0 + } 0000040 \ x { 7 1 7 5 } \ x { 6 5 7 5 + } 0000060 \ x { 2 0 3 b } \ x { 5 f 5 2 + } 0000100 \ x { 7 5 5 4 } \ x { 6 2 7 2 + }

I actually got my hands on a WinXP machine running ActivePerl and ran the script with this code on XP, and got the above output.

Horrible thing is (for my friend) when I run my original script on XP, it works like I expect - NOT producing the \x00 bytes! I don't understand this, and I can't replicate it, and I can't visit him (10 time zones away) to see WTF is going on.

Replies are listed 'Best First'.
Re^4: script inserts \x00 bytes on WinXP
by ikegami (Patriarch) on Sep 06, 2008 at 01:53 UTC
    It's not Perl. The input file he used is different than yours, the output file he gave you is not the output he really got, or the script he used is different. The most likely explanation is that somewhere before or after the script was run, the input or output file was converted to UTF-16.