[Ironpython-users] ipy64 Unicode file vs. pipe

Slide slide.o.mix at gmail.com
Thu Apr 4 00:32:22 CEST 2013

Pipe vs. file differences would probably be the realm of the shell you are
running under, not ipy. To ipy, its just stdout.

On Wed, Apr 3, 2013 at 12:25 PM, Malcolm Slaney <malcolmslaney at gmail.com>wrote:

> Maybe this is well known, but I couldn't find it on the web.
> Iron Python is pretty wonderful, but it gave me very confusing output.  It
> likes Unicode.  But I don't want Unicode output.  All my output (as part of
> a processing chain) are numbers and spaces.   ASCII is good for this (and
> that's what the other tools want.)
> If I run a simple command and send the output to a file I get Unicode. But
> the exact same command when sent to a pipe gives me ASCII.  ARGGHH.   Took
> me a long time to figure out this simple test case.
> This behavior should be (better) documented.  Hopefully this email will
> save
> somebody else a lot of head scratching.
> - Malcolm
> P.S.  The example below uses the Gnu on  Windows command od to display the
> actual contents of the file in hex.  The first example shows ASCII output,
> while the second output looks like Unicode to me.
> PS Z:\PitchTracking> ipy64.exe -c "print 'hello'" | od -x
> 0000000 6568 6c6c 0d6f 000a
> 0000007
> PS Z:\PitchTracking> ipy64.exe -c "print 'hello'" > junk
> PS Z:\PitchTracking> od -x junk
> 0000000 feff 0068 0065 006c 006c 006f 000d 000a
> 0000020
> _______________________________________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/mailman/listinfo/ironpython-users

Website: http://earl-of-code.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130403/81981a55/attachment.html>

More information about the Ironpython-users mailing list