[squeak-dev] Re: OSProcess and multiline input

David T. Lewis lewis at mail.msen.com
Sat Feb 25 00:08:08 UTC 2012


On Fri, Feb 24, 2012 at 03:46:58PM -0800, Sean P. DeNigris wrote:
> 
> Eliot Miranda-2 wrote
> > 
> > OSP is an interface to exec.
> 
> That's good to know. Thanks.
> 
> I investigated further and accidentally found out that it wasn't the
> multi-line part at all that was the problem. It was that my string contained
> an ellipsis, which forced the argument to waitForCommand: into a WideString.
> Is there a workaround? can OSP only handle ByteStrings?

OSProcess connects to external processes using a StandardFileStream rather
than a MultiByteFileStream, and I suspect that this is related to your
problem. Squeak's multi-byte character support did not yet exist when I
wrote OSProcess and CommandShell, and I am afraid that an update for this
is long overdue ... 

In any case, if you can think of a way to convert your multi-byte input
string into exactly the steam of bytes that the program expects on its
input (more or less as Eliot was suggesting in his reply), then you may
find that it works. I don't have a Mac to try any of this on, so I really
should not attempt to guess at it, but I have a hunch that if you were
to convert your multi-byte input string into a byte array, thence back
to a string of 8-bit characters (two "characters" for each 16-bit character),
then feed this to a PipeableOSProcess, it might just work. Please let me
know in the unlikely event that I guessed right ;-)

Dave



More information about the Squeak-dev mailing list