2011/8/16 Bhavesh Sharma <bhavesh1_sharma / rediffmail.com>:
> Hi Brian,
>
> Thanks for your inputs.
>
> I tried the way you mentioned :
>
> issueCommandInKazBox($node1, "add user  role
> admin".force_encoding("ASCII-8BIT"), "")
>
> And it worked :)
>
> I still surprise why it is not working when i use utg8 instead of
> ascii-8bit

Just for future reference: "ASCII-8BIT" encoding is the same as
"BINARY" encoding.

Therefore setting encoding to "ASCII-8BIT" is equivalent to "erasing"
encoding information, and many libraries who depend on "byte" having
the same meaning as "character" (ie., anything that uses string[n]
notation on binary data...) just may accidentally work right.

If you ever get encoding-related errors, common sense doesn't seem to
work, and you don't really care about the data that blows up, just
force_encoding('binary') on everything :)

-- Matma Rex