node-irc icon indicating copy to clipboard operation
node-irc copied to clipboard

Optional unicode nickname support

Open simnalamburt opened this issue 9 years ago • 4 comments

TL;DR

Hey it's 2016 and it's time to use unicode.


Most IRC clients allows unicode nickname; irssi, weechat, MozIRC, IRCCloud, shoutIRC, ZNC, etc. And most CJK IRC servers allows unicode nickname; http://ozinger.org/, http://www.hanirc.org/, http://www.luatic.net/, https://twitter.com/HanIRC, etc. I know that current IRC spec does not allow non-ASCII nickname but that spec has not been changed for 16 years and CJK and non American users cannot use IRC without unicode nickname support.

2016-03-26 4 53 40

There were so many requests that ask node-irc to allow non-ASCII nickname. There're so many forks which enable non-ASCII nickname. And non of them were taken seriously.

It's 2016 and it's a shame to know that node-irc does not support non-ASCII nickname while everyone else does. Supporting unicode nickname is not just technical but also an ethnic issue.

  • https://github.com/martynsmith/node-irc/pull/377, https://github.com/martynsmith/node-irc/pull/377/commits/78847c13b3c133aacfb90c5314b564aaf296053e (@outsideris, @kimdwkimdw)
  • https://github.com/martynsmith/node-irc/pull/408, https://github.com/martynsmith/node-irc/pull/408/commits/31b790618fb817fc765cfe60b10ed576beced1d9 (@leeopop)
  • https://github.com/VBChunguk/node-irc/commit/a2f02f76559660de897333e35b5cbe7c72afa79a (@VBChunguk)
  • https://github.com/martynsmith/node-irc/issues/104 (@sinoru)
  • https://github.com/martynsmith/node-irc/pull/175 (@ejnahc)

If you're interested in strictly following RFC2812, please at least enable this feature optionally.


Note Personally I had no option but to use slate-irc so I changed my all codes to use slate-irc instead of node-irc.

simnalamburt avatar Mar 25 '16 20:03 simnalamburt

Thanks for this report. I'll take a look at this today and see what I can do.

jirwin avatar Mar 27 '16 17:03 jirwin

Maybe it's deprecated now but i used to Send/write nick as binary to the server ('NICK '+nick+'\r\n', 'binary');

Trinitas avatar Mar 31 '16 08:03 Trinitas

I'm not particularly well-acquainted with this project, but I'm not actually sure what spec we should be going by that permits Unicode nicknames? I haven't seen a specific one mentioned, looking around the project briefly, but RFC2812 doesn't allow them (as said in the start of this issue):

message    =  [ ":" prefix SPACE ] command [ params ] crlf
prefix     =  servername / ( nickname [ [ "!" user ] "@" host ] )
nickname   =  ( letter / special ) *8( letter / digit / special / "-" )
letter     =  %x41-5A / %x61-7A       ; A-Z / a-z
digit      =  %x30-39                 ; 0-9
special    =  %x5B-60 / %x7B-7D
                 ; "[", "]", "\", "`", "_", "^", "{", "|", "}"

At present it looks like the code matches this spec (mostly) – it looks in the prefix for the Regex pattern:

/^([_a-zA-Z0-9\~\[\]\\`^{}|-]*)(!([^@]+)@(.*))?$/

(the 1st, 3rd and 4th matches are made into the nick, user and host params, or if nothing is matched, it makes the whole prefix into the message's server)

I also found this spec which is apparently in the process of being written and seems to be part of 'IRCv3', but it doesn't yet specify what can go into a nickname.

Any ideas?

Edit: Or we could just hope to merge one of the already existing PRs, I guess.

Throne3d avatar Mar 25 '17 20:03 Throne3d

sorry I can not speak english well.

I had this problem with teleirc.

match = message.prefix.match(/^([_a-zA-Z0-9\~\[\]\\`^{}|-]*)(!([^@]+)@(.*))?$/);

this line edit to

match = message.prefix.match(/^([_a-zA-Z0-9\~\[\]\\`^{}|-|\u0100-\ud800]*)(!([^@]+)@(.*))?$/);

and work well with korean

dagenim avatar Aug 09 '17 14:08 dagenim