문제

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top