<div dir="ltr">Pipe vs. file differences would probably be the realm of the shell you are running under, not ipy. To ipy, its just stdout.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 3, 2013 at 12:25 PM, Malcolm Slaney <span dir="ltr"><<a href="mailto:malcolmslaney@gmail.com" target="_blank">malcolmslaney@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe this is well known, but I couldn't find it on the web.<br>
<br>
Iron Python is pretty wonderful, but it gave me very confusing output.  It<br>
likes Unicode.  But I don't want Unicode output.  All my output (as part of<br>
a processing chain) are numbers and spaces.   ASCII is good for this (and<br>
that's what the other tools want.)<br>
<br>
If I run a simple command and send the output to a file I get Unicode. But<br>
the exact same command when sent to a pipe gives me ASCII.  ARGGHH.   Took<br>
me a long time to figure out this simple test case.<br>
<br>
This behavior should be (better) documented.  Hopefully this email will save<br>
somebody else a lot of head scratching.<br>
<br>
- Malcolm<br>
P.S.  The example below uses the Gnu on  Windows command od to display the<br>
actual contents of the file in hex.  The first example shows ASCII output,<br>
while the second output looks like Unicode to me.<br>
<br>
<br>
<br>
PS Z:\PitchTracking> ipy64.exe -c "print 'hello'" | od -x<br>
0000000 6568 6c6c 0d6f 000a<br>
0000007<br>
<br>
PS Z:\PitchTracking> ipy64.exe -c "print 'hello'" > junk<br>
PS Z:\PitchTracking> od -x junk<br>
0000000 feff 0068 0065 006c 006c 006f 000d 000a<br>
0000020<br>
<br>
_______________________________________________<br>
Ironpython-users mailing list<br>
<a href="mailto:Ironpython-users@python.org">Ironpython-users@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">http://mail.python.org/mailman/listinfo/ironpython-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Website: <a href="http://earl-of-code.com" target="_blank">http://earl-of-code.com</a>
</div>