mIRC Home    About    Download    Register    News    Help

Topic Options
#229134 - 22/01/11 02:23 AM Sending non UTF-8 encoded text from script?
dabb Offline
Nutrimatic drinks dispenser

Registered: 10/04/03
Posts: 9
Using mIRC 7.x, I'm having some issues with clients that don't support unicode. I use $chr(160) heavily in my scripts and it now sends \xc2\xa0.

From the script language, is there anyway to force /msg to send a message with no UTF-8 encoding? I disabled "UTF-8 encode/decode messages" from Options->IRC->Messages but it seems to have no effect. As a workaround, I tried using "/raw -n PRIVMSG :<msg>", but that still seems to be sending \xc2\xa0 for $chr(160).

Any ideas? Or is going back to 6.35 my only option?

Top
#229138 - 22/01/11 06:58 AM Re: Sending non UTF-8 encoded text from script? [Re: dabb]
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
According to the help file, your usage of the -n switch with the /raw command is the correct method.

I don't know if this was a typo or not, but I did notice that the /raw command you posted appeared to be missing a parameter.

You posted /raw -n PRIVMSG :<msg>
When I believe it should be /raw -n PRIVMSG <nickname> :<message>

As you can see, the line you posted is missing the <nickname> parameter.

Top
#229154 - 22/01/11 02:36 PM Re: Sending non UTF-8 encoded text from script? [Re: dabb]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
$chr(160) should really NOT be used without UTF8. In UTF8, it will be a space for everyone who views it as UTF8, but without UTF8, it can be a variety of things depending on a user's code page. Rather than trying to use it where it's not always going to display the way you think it is, you should use something else instead. Just because you can see it as a space doesn't mean everyone does. For some, it will appear as a box, for others, it may appear as some other character. All depending on code pages. This is true even if you send that character from mIRC 6.35 or older (i.e. not encoded).

If all you're doing is putting in multiple spaces, there are other methods that will display correctly no matter who looks at them and no matter whether or not they are viewing it in UTF8.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#229162 - 22/01/11 05:57 PM Re: Sending non UTF-8 encoded text from script? [Re: Riamus2]
dabb Offline
Nutrimatic drinks dispenser

Registered: 10/04/03
Posts: 9
Originally Posted By: Riamus2
If all you're doing is putting in multiple spaces, there are other methods that will display correctly no matter who looks at them and no matter whether or not they are viewing it in UTF8.


I am putting out multiple spaces so columns of data always "line up" assuming a proportional font is being used. Please do tell what these other methods are. smile

Top
#229169 - 22/01/11 10:02 PM Re: Sending non UTF-8 encoded text from script? [Re: dabb]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
There are a couple of options that come to mind. First is to use spaces.dll, which is designed to allow outputting multiple spaces. The other option is to use a CTRL code between spaces. If you don't need to keep colors/bold/underline/etc, then the best method would be using Ctrl-O... space Ctrl-O space Ctrl-O space. You can use $str() to repeat that as many times as you need. It does double the number of characters for each space, but unless you're using long lines, it's not a problem. And if you are aligning things, I doubt you're using long lines because wrapping would mess things up. If you do need to keep previous codes, then you can use double Ctrl-B or double Ctrl-U or whatever. That increases line length even more, but also works fine.

The use of CTRL codes work very well and are not seen except if someone tries to copy the line(s) holding CTRL or tries to read a log file somewhere that doesn't hide the CTRL code. The use of the DLL works even better as long as you don't mind using a DLL.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#229193 - 24/01/11 07:39 AM Re: Sending non UTF-8 encoded text from script? [Re: Riamus2]
dabb Offline
Nutrimatic drinks dispenser

Registered: 10/04/03
Posts: 9
spaces.dll works beautifully, thanks for the tip! I wish I had run across it a long time ago.

Top
#231739 - 29/04/11 10:58 PM Re: Sending non UTF-8 encoded text from script? [Re: dabb]
Finiderire Offline
Self-satisified door

Registered: 04/06/08
Posts: 3
Hi,

In mIRC v6.35 Options \ IRC \ Messages you had "SJIS/JIS conversion, UTF-8 display, Multibyte display, Multibyte editbox,
Font linking, ANSI codes"
In mIRC v7.19 there is only "UTF-8 encode/decode messages".
On an UTF-8 server with most non UTF-8 users, I should decode UTF-8 but not encode. How can I do this now ?

a+, =)
-=Finiderire=-

Configuration : mIRC v7.19

Top
#231743 - 30/04/11 03:31 AM Re: Sending non UTF-8 encoded text from script? [Re: Finiderire]
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
There are many threads regarding the use of codepages. mIRC supports UTF8 now. If you want to use codepages, you will need to stick with 6.35. That or try to get people to start using UTF8. Just about every client out there supports it, so unless it's due to a server that won't support it, there is no reason not to start using UTF8.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#231745 - 30/04/11 04:19 AM Re: Sending non UTF-8 encoded text from script? [Re: Finiderire]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3503
Loc: France
mirc has /raw -n, that do not encode in utf8 characters in the range 0-255, so you can keep "UTF-8 encode/decode messages" checked and use /raw -n to override mirc's default behavior when sending a message (halting on input)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top