mIRC Homepage
Posted By: DeathWolf Read - binary content - 07/03/06 04:51 PM
it seems that $read() will stop if it finds some characters it considers "binary"

I've been trying to paste the raw utf-16 content of a file, and it will stop after the control characters, i think the behaviour should be to ignore chars that can cause trouble, and to return the other ones.

If there's a workaround i dont mind hearing about it though.
Posted By: DaveC Re: Read - binary content - 07/03/06 06:54 PM
At a guess its likely running into a eof marker $chr(26) or a $chr(0), if its the $chr(0) mirc cant display it, and sees this as end of text, if it happens to be the first characters your loop might be terminating with a $null maybe?
Posted By: DeathWolf Re: Read - binary content - 07/03/06 10:12 PM
indeed, but a way to "remove" the offending characters would be very useful i guess
Posted By: DaveC Re: Read - binary content - 08/03/06 12:06 AM
//var %file = "test.txt" | bread %file 0 $file(%file) &binvar | breplace &binvar 00 32 | bwrite %file 0 -1 &binvar

* the above replaces the $chr(0) with a space. (of course i was only speculating as to if this is the cause of it stopping early)
Posted By: genius_at_work Re: Read - binary content - 08/03/06 01:48 AM
Now I know absolutely nothing about unicode, but I seem to recall that mIRC uses UTF-8. I don't know if UTF-16 is compatible with UTF-8 or not, but if it isn't, that may be a source of the error.

-genius_at_work
Posted By: DeathWolf Re: Read - binary content - 08/03/06 08:23 PM
actually there's no way utf-16 was going to be mirc compliant
i was merely working on conversion scripts in mirc that's all
I just thought that a raw(even if garbaged) output wouldnt be a prob.
© mIRC Discussion Forums