mIRC Home    About    Download    Register    News    Help

Print Thread
#168268 06/01/07 03:00 AM
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
Hello all,
I have a text file and i'd like to paste the content totally raw.
Because of that i cant use msg/say since it'll auto-convert to utf-8(which i dont want).
I used to use raw privmsg in 6.17-6.20, but it seems this isnt working anymore, and the
Quote:
raw privmsg $1 : $+ $read("file.txt",1)
command wont work anymore(it sends an empty string to the server...)
doing
Quote:
echo -t $1 $read("file.txt",1)
does work though, which leads me to think it's a problem with raw and non-utf8 content.
Please note that on the local client, the raw privmsg displays well, it's just it's as if it wasnt transmitted to the server.
Note: fread converts to utf-8 without asking too.
Thanks for any confirmation of that problem and/or solution,

DeathWolf


EDIT:

Example:
if i bread my file, or hexedit it, i find the following values for each byte: 131 101 131 88 131 103 13 10
These are the dec values i'd like the client to receive as normal bytes(provided the server accepts it, but that's another problem)

Now the problem is that if i do either a $bread or the following:
Quote:
raw privmsg $nick : $+ $chr(131) $+ $chr(101) $+ $chr(131) $+ $chr(88) $+ $chr(131) $+ $chr(103) $+ $chr(13) $+ $chr(10)

or simply
Quote:
msg $nick $chr(131) $+ $chr(101) $+ $chr(131) $+ $chr(88) $+ $chr(131) $+ $chr(103) $+ $chr(13) $+ $chr(10)


and mirc auto magically converts it to utf-8 without asking... which is quite disturbing...

EDIT2: I've tested about all method i can think of to send/use text, and it seems that mirc really wants to automatically do the locale->utf-8 conversion regardless of the method...
That's a bit sad since it's quite limiting on raw text that one could normally send:/ Maybe i should post in suggestion? Or did i forget some point?

EDIT3: after checking i found out that the logs do exhibit the correct encoding if i do the local echo. So the conversion only seems to be forcefully done after the raw privmsg is done, and before it reaches the server, leading me to think that all strings regardless of origin gets forcefully converted...

EDIT4: here is another testcase to exhibit the behavior:
Code:
alias testglup {
  .set %var1 : $+ $chr(131) $+ $chr(101) $+ $chr(131) $+ $chr(88) $+ $chr(131) $+ $chr(103)
  msg $1 %var1
  .echo -t %var1
}

This shows in the logs as twice the same thing for the $chr'ed text(bit to bit), but the message is transmitted differently and it arrives as the following bytes:
227 131 134 227 130 185 227 131 136
which is the unicode transformation from my locale to utf-8 of
131 101 131 88 131 103 13 10

NOTE: this isnt server related, i confirmed it on multiple different ircd, some very simple, some much more complex. and moreover that behaviour appeared after 6.17

Last edited by DeathWolf; 06/01/07 03:47 AM.
Joined: Jan 2007
Posts: 1
R
Mostly harmless
Offline
Mostly harmless
R
Joined: Jan 2007
Posts: 1
Even i did not understand completely your problem try 2 things related with the new version of mirc.First see the options provided for utf-8 encoding at mirc fonts dialog and second in options dialog at IRC->Messages section.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
I;ve never had a problem with the raw command. Only thing I can suggest is what it says in the help file.
"You must know the correct RAW format of the command you are sending."

Meaning you need to send it to the server exactly how the server wants it or it won't work. Your format looked right. I always test with static text if it doesn't work.

.raw privmsg $chan TEST $read(file.txt,1)

Last edited by DJ_Sol; 18/01/07 07:09 AM.
DJ_Sol #169602 26/01/07 02:04 AM
Joined: Oct 2003
Posts: 110
D
Vogon poet
OP Offline
Vogon poet
D
Joined: Oct 2003
Posts: 110
well, i have done plenty of test since then, and the fact is that whenever mirc processes any form of text data, it converts it to utf-8 if utf-8 is enabled, and that regardless of anything else.
Because of that, my old script that converted between codepages and displayed the result cannot work, since mirc will convert without asking.
Guess it wont change though...
It would need some sort of nasty hack to get around it(that is intercept the string and modify it or so...)

Example: My script works using a dll i made that calls upon iconv to convert text between 2 codepages, and so, the input string is sent as utf-8(since utf-8 is enabled) to iconv, and when the text is returned after conversion, it is in the right codepage(that is if i write the result of the dll call to a file, it's right). But if i send it to the chan, regardless of the method, it gets converted to utf-8 even if that means breaking completly it(since it converts from locale->utf-8). I really think a true raw way of sending command is necessary:/ maybe i should make it a feature request.

Last edited by DeathWolf; 26/01/07 02:09 AM.

Link Copied to Clipboard