mIRC Home    About    Download    Register    News    Help

Print Thread
#144222 07/03/06 04:51 PM
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
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.

#144223 07/03/06 06:54 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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?

#144224 07/03/06 10:12 PM
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
indeed, but a way to "remove" the offending characters would be very useful i guess

#144225 08/03/06 12:06 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
//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)

#144226 08/03/06 01:48 AM
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

#144227 08/03/06 08:23 PM
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
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.

Last edited by DeathWolf; 08/03/06 08:24 PM.

Link Copied to Clipboard