mIRC Homepage

Unicode confusion

Posted By: goblin58

Unicode confusion - 13/03/19 11:30 PM

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.
Posted By: Khaled

Re: Unicode confusion - 14/03/19 12:25 AM

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.

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.

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.
Posted By: goblin58

Re: Unicode confusion - 14/03/19 03:43 AM

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.
Posted By: Wims

Re: Unicode confusion - 17/03/19 02:36 PM

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
© 2019 mIRC Discussion Forums