mIRC Home    About    Download    Register    News    Help

Print Thread
Unicode confusion #265168 13/03/19 11:30 PM
Joined: Nov 2017
Posts: 15
G
goblin58 Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Nov 2017
Posts: 15
Hi Everyone,

I hope this is the correct forum. I'm somewhat confused by unicode support in mirc. Reading the web states that mirc has implemented unicode as utf16, however there is an option for utf8 messages.

Also, the DLL interface passes data over as a char *, casting this pointer to an unsigned char * seems to yield the correct results as far as utf8 is concerned.

So, is the char * pointing to a chunk of memory as utf16 or utf8?

Please help, this old developer is confused.

Re: Unicode confusion [Re: goblin58] #265169 14/03/19 12:25 AM
Joined: Dec 2002
Posts: 4,538
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,538
In Windows, applications can be compiled as single-byte ANSI or multi-byte Unicode. mIRC was originally an ANSI application. It was converted to Unicode. That is what is meant by Unicode in this context. Unicode in Windows applications is UTF-16.

Quote:
however there is an option for utf8 messages

This option is present because some users requested the ability to disable Unicode/UTF-8 conversion in incoming/outgoing messages.

Quote:
DLL interface passes data over as a char *

DLL support was added long ago. It supports char* for backwards compatibility. When a DLL is called, mIRC automatically converts parameters/results to/from Unicode/UTF-8.

Re: Unicode confusion [Re: Khaled] #265171 14/03/19 03:43 AM
Joined: Nov 2017
Posts: 15
G
goblin58 Offline OP
Pikka bird
OP Offline
Pikka bird
G
Joined: Nov 2017
Posts: 15
Thanks so much Khaled, that makes perfect sense. In the mean time I have my code working and can now detect the Unicode script(s) in a message and can finally kill those pesky multi Unicode script spammers.

Re: Unicode confusion [Re: goblin58] #265207 17/03/19 02:36 PM
Joined: Jul 2006
Posts: 3,568
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,568
A bit late, but for future readers, you can find useful informations/examples and more in depth explanation of how to make a dll for mIRC here: https://en.wikichip.org/wiki/mirc/dynamic-link_library


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net