Subj : Re: How to create options for modopt To : Digital Man From : martylake Date : Tue Dec 07 2021 23:40:50 > Re: How to create options for modopt > By: martylake to All on Tue Dec 07 2021 01:31 am > Did you read this: http://wiki.synchro.net/config:modopts.ini ? Not yet ! Thank you very much for the link. Here is a patch for fixing irc.js encoding scrambling, it consists of two parts: * convert incoming UTF8 to CP437 when communicating with a server, but the client is not UTF8 * convert to UTF8 when sending messages to the client, if supported Not sure if it's the optimal way of implementing this, I had the expected behavior with thes two test setup: * synchronet's irc server: * syncterm * ubuntu terminal utf8 ssh * irc client via znc utf8 * inspircd server * syncterm * ubuntu terminal utf8 ssh * irc client via znc utf8 Best, martylake From 1414ee4803d1e71749a160a56d783df68668b4a5 Mon Sep 17 00:00:00 2001 From: martylake Date: Wed, 8 Dec 2021 08:15:12 +0100 Subject: [PATCH 1/2] When the user console is not UTF8, encode and decode from/to CP437 --- exec/irc.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/exec/irc.js b/exec/irc.js index 233bbef77..ad1afd246 100644 --- a/exec/irc.js +++ b/exec/irc.js @@ -34,6 +34,8 @@ var real_names=true; js.on_exit("console.ctrlkey_passthru = " + console.ctrlkey_passthru); console.ctrlkey_passthru=~(134217728); +var options = load('modopts.js', 'fseditor'); +var utf8_support = ((options && options.utf8_support) || true) && console.term_supports(USER_UTF8); //default to true // Commands to send... var client_cmds = { 'PASS':{minparam:1,maxparam:1}, // Must be sent before NICK/USER @@ -223,6 +225,10 @@ function send_cmd(command, params) screen.print_line("\x01H\x01R!! \x01N\x01R"+command+" requires at least "+cmd.minparam+" parameters\x01N\x01W"); return; } + if(!utf8_support) + { + snd = utf8_encode(snd); + } sock.send(snd+"\r\n"); } @@ -566,6 +572,9 @@ function get_command() line=sock.recvline(); if(!line) return; + if(!utf8_support .