简体   繁体   中英

Delphi XE2 Indy IRC Unicode

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

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM