Am 10.06.2005 um 15:41 schrieb Vlad Seryakov:

* Tcl_GetByteArrayFromObj --
*
*      Attempt to get the array of bytes from the Tcl object.  If the
*      object is not already a ByteArray object, an attempt will be
*      made to convert it to one.

So, if i call ns_return from Tcl and pass data parameter, it will be always type of String. ByteArrays are created from Tcl by binary command only, other commands work with String types, so i need to tell ns_return to treat data as bytearray. Tcl string can contain binary data but it is still String and that check will never work for binary data.


I'm afraid you are right. I also have my own (binary-aware) ns_return somewhere
in my toolbox but never thought it would be of general interest.

OTOH, the "ns_return -binary" would look nicer but I do not
know if we'd be backwardly-compatible (guess not).

Zoran


Reply via email to