mIRC Home    About    Download    Register    News    Help

Topic Options
#265168 - 13/03/19 11:30 PM Unicode confusion
goblin58 Offline
Pikka bird

Registered: 22/11/17
Posts: 13
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.

Top
#265169 - 14/03/19 12:25 AM Re: Unicode confusion [Re: goblin58]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4441
Loc: London, UK
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.

Top
#265171 - 14/03/19 03:43 AM Re: Unicode confusion [Re: Khaled]
goblin58 Offline
Pikka bird

Registered: 22/11/17
Posts: 13
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.

Top
#265207 - 17/03/19 02:36 PM Re: Unicode confusion [Re: goblin58]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3506
Loc: France
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

Top