0
votes

Is it possible to get there unicode support? Right now on IdIRC1PrivateMessage i have '?' Thanks for help.

procedure TForm1.IdIRC1PrivateMessage(ASender : TIdContext;
const ANicknameFrom, AHost, ANicknameTo, AMessage : unicodestring);

begin
  Memo1.Lines.Add(TimeToStr(Time) + ': ' + ANicknameFrom + ':  ' + AMessage);
end;

Indy version: 10.5.8.0. When i will send message in mIRC eg 'żźć' i will get "???" in delphi

1
IRC is an obsolete protocol, that does not know about languages, charsets, and unicode as well. en.wikipedia.org/wiki/IRC#Character_encoding Can you use XMPP or some other modern protocol instead ? - Arioch 'The
"Right now on IdIRC1PrivateMessage i have '?'" what do you mean ? Oh, and by the way, what do you mean by "unicode" ? there is a half-dozen of Unicode formats. Specifying Indy version would be a good thing too. Sometimes it becomes important info. And maybe getting new Indy version: indyproject.org/Sockets/Download/Files/Indy10.EN.aspx - Arioch 'The
Indy version: 10.5.8.0. When i will send message in mIRC eg 'żźć' i will get "???" in delphi - user2512579
Judging by indyproject.org/docsite/html/!!MEMBEROVERVIEW_TIdIRC.html you have little lack with Indy unless they changed it after XE2 release. Well, they would have to change this, as it using strings for binary data is against XE4 guidelines. For now you can try using pre-Unicode Delphi or UTF-8 based CodeTyphon/Lazarus or fix the sources of Indy to add charset support. Maybe spawning IRC into separate thread with non-default codepage would help, but more probably would confuse Delphi RTL to have several codepages inside single applications. - Arioch 'The
is mIRC configured to use UTF8? configure it to use the same charset, that your Windows has... The last paragraph at synapse.ararat.cz/doku.php/public:howto:d2009 is about the similar issues that Indy has now. I guess that you should fix all the code on Indy IRC to fix UTF-16 strings of XE2 conversion to 8-byte strings of IRC and back. Or change the library. VisualIRC project has sources, but they were released to pre-unicode Delphi and may be of little help for you. Or not. Anyway, IRC is outdated and you can choose better chat options. Like IntranetChat remakes or XMPP - Arioch 'The

1 Answers

0
votes

The IRC protocol itself does not provide any provisions for Unicode. mIRC implements Unicode by using UTF-8 where applicable (see this article).

TIdIRC does not natively support Unicode. However, you can manually tell TIdIRC to encode/decode data using UTF-8 by setting the TIdIOHandler.DefStringEncoding property to IndyUTF8Encoding after connecting, or by setting the global IdGlobal.GIdDefaultTextEncoding variable to encUTF8 (it is set to encASCII by default). I make no guarantee that it will work correctly in all situations though (particularly during CTC/DCC operations).