]> jfr.im git - irc/kvirc/KVIrc.git/commitdiff
Implement the UTF8ONLY IRCv3 specification (#2514)
authorVal Lorentz <redacted>
Fri, 4 Aug 2023 17:55:05 +0000 (19:55 +0200)
committerGitHub <redacted>
Fri, 4 Aug 2023 17:55:05 +0000 (19:55 +0200)
* Implement the UTF8ONLY IRCv3 specification

https://ircv3.net/specs/extensions/utf8-only

* Fix string length

src/kvirc/sparser/KviIrcServerParser_numericHandlers.cpp

index 193cafe2eeec785b0423e774485e77526590e399..079f1fd1deaca6021b7720894c50aec73f742d53 100644 (file)
@@ -269,6 +269,7 @@ void KviIrcServerParser::parseNumeric005(KviIrcMessage * msg)
                         * CALLERID -> The server supports server side ignores via the +g user mode
                         * ACCEPT -> The server supports server side ignore (deprecated by CALLERID)
                         * LANGUAGE -> The server supports the LANGUAGE command (experimental, e.g. LANGUAGE=2,en,i-klingon)
+                        * UTF8ONLY -> The server supports only UTF-8 messages in both directions https://ircv3.net/specs/extensions/utf8-only
                         */
                        if(kvi_strEqualCIN("PREFIX=(", p, 8))
                        {
@@ -375,6 +376,10 @@ void KviIrcServerParser::parseNumeric005(KviIrcMessage * msg)
                                if((!_OUTPUT_MUTE) && (!msg->haltOutput()) && KVI_OPTION_BOOL(KviOption_boolShowExtendedServerInfo))
                                        msg->console()->outputNoFmt(KVI_OUT_SERVERINFO, __tr2qs("This server supports the WHOX, extra information will be retrieved"));
                        }
+                       else if(kvi_strEqualCIN("UTF8ONLY", p, 8))
+                       {
+                               msg->connection()->setEncoding("UTF-8");
+                       }
                }
                if((!_OUTPUT_MUTE) && (!msg->haltOutput()))
                {