简体   繁体   English

Delphi XE2 Indy IRC Unicode

[英]Delphi XE2 Indy IRC Unicode

Is it possible to get there unicode support? 是否有可能获得unicode支持? Right now on IdIRC1PrivateMessage i have '?' 现在在IdIRC1PrivateMessage上我有“?” 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. Indy版本:10.5.8.0。 When i will send message in mIRC eg 'żźć' i will get "???" 当我在mIRC中发送消息时,例如“żźć”,我将得到“ ???” in delphi 在德尔福

The IRC protocol itself does not provide any provisions for Unicode. IRC协议本身不提供Unicode的任何规定。 mIRC implements Unicode by using UTF-8 where applicable (see this article ). mIRC在适用时使用UTF-8实现Unicode(请参阅本文 )。

TIdIRC does not natively support Unicode. TIdIRC本身不支持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). 但是,您可以手动告诉TIdIRC通过设置编码/使用UTF-8解码的数据TIdIOHandler.DefStringEncoding属性IndyUTF8Encoding连接,或通过全局设置后IdGlobal.GIdDefaultTextEncoding变量encUTF8 (它被设置为encASCII默认情况下)。 I make no guarantee that it will work correctly in all situations though (particularly during CTC/DCC operations). 我不能保证它在所有情况下都能正常工作(尤其是在CTC / DCC操作期间)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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