Damien Elmes | 5 Dec 2004 10:53

supporting foreign characters in server messages

Hi folks,

I jumped on a network the other day which doesn't use any English, and
their server messages (such as MOTD and LIST messages) are sent using
a 7bit character encoding (iso-2022-jp). You can test it if you want
want by going to irc.2ch.net.

Unfortunately it seems like ERC can't cope with foreign characters in
the server messages yet - at least not on my setup. I hacked up a
quick patch to fix the problem for me, and thought someone might be
interested. It's probably not suitable for inclusion in ERC yet, but I
wanted to know if anyone has thought of a better way to support
foreign characters in this context. Note that I changed the TOPIC
handler since I thought a more generalised solution would be better -
which means that after the patch is applied /topic messages won't be
customisable on a per-channel basis, until
erc-decode-server-message-string is improved.

Any thoughts?

Damien

--- erc-backend.el	10 Nov 2004 17:01:42 +0900	1.15
+++ erc-backend.el	05 Dec 2004 18:39:31 +0900	
 <at>  <at>  -110,6 +110,19  <at>  <at> 
   (command-args '() :type list)
   (contents "" :type string))

+(defvar erc-delayed-decoding-responses '("PRIVMSG" "NOTICE")
+  "A list of responses which handle character decoding by themselves")
(Continue reading)

It's me FKtPp ; | 6 Dec 2004 01:02
Favicon

Re: supporting foreign characters in server messages

Damien Elmes <erc-help <at> repose.cx> writes:

> Hi folks,
> 
> I jumped on a network the other day which doesn't use any English, and
> their server messages (such as MOTD and LIST messages) are sent using
> a 7bit character encoding (iso-2022-jp). You can test it if you want
> want by going to irc.2ch.net.
> 
> Unfortunately it seems like ERC can't cope with foreign characters in
> the server messages yet - at least not on my setup. I hacked up a
> quick patch to fix the problem for me, and thought someone might be
> interested. It's probably not suitable for inclusion in ERC yet, but I
> wanted to know if anyone has thought of a better way to support
> foreign characters in this context. Note that I changed the TOPIC
> handler since I thought a more generalised solution would be better -
> which means that after the patch is applied /topic messages won't be
> customisable on a per-channel basis, until
> erc-decode-server-message-string is improved.
> 
> Any thoughts?
> 
> Damien
> 
> --- erc-backend.el	10 Nov 2004 17:01:42 +0900	1.15
> +++ erc-backend.el	05 Dec 2004 18:39:31 +0900	
>  <at>  <at>  -110,6 +110,19  <at>  <at> 
>    (command-args '() :type list)
>    (contents "" :type string))
>  
(Continue reading)

Nelson Ferreira | 6 Dec 2004 01:37
Picon
Gravatar

Error in support for mirc colors.


Hi all,

Not sure what in the irc message triggers this, but in a particular
group I keep on getting this error (also reproducible by a /list on
irc.dal.net).

Any idea of how better to troubleshoot ?

ERC version 4 $Revision: 1.675$

Invalid function: (macro . #<compiled-function (string) "...(7)" [string when erc-log-p erc-log-aux]
4 ("/usr/lib/xemacs/xemacs-packages/lisp/erc/erc.elc" . 58404)>)

Thanks,

        Nelson

--

-- 
Nelson Ferreira

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
Alex Schroeder | 8 Dec 2004 02:46
Face

Re: Re: supporting foreign characters in server messages

If we use your patch, I will need you to sign copyright papers.  Is
this ok for you?  If yes, I will send you a longer mail with some more
info.

Alex.
--

-- 
.O.  http://www.emacswiki.org/alex/
..O  Schroeder's fifth law:
OOO  Never accept more work than you can handle in one night of hacking.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
It's me FKtPp ; | 8 Dec 2004 23:53
Favicon

Re: supporting foreign characters in server messages

Alex Schroeder <alex <at> emacswiki.org> writes:

> If we use your patch, I will need you to sign copyright papers.  Is
> this ok for you?  If yes, I will send you a longer mail with some more
> info.

If you think my patch is helpful. I'd glade to sign copyright to ERC
Group or FSF or anyone who can help erc support NON-ASCII characters.

yours FKtPp

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
Brian Palmer | 11 Dec 2004 10:39
Picon
Favicon

case-sensitive ctcp messages

I got a bug report about having to do a /ctcp nick VERSION instead of
/ctcp nick version (and similar).  Apparently other clients (such as
bitchx) automatically upcase the ctcp command. It's not clear to me
that is a technically correct thing to do, looking at the various
specs on irchelp, but it certainly strikes me as more convention, and
the likelihood that someone would expect 'version' to do something
other than 'VERSION' strikes me as low.

I'm proposing the below patch. Feedback would be welcome; otherwise
I'll commmit it soon.

Index: erc.el
===================================================================
RCS file: /cvsroot/erc/erc/erc.el,v
retrieving revision 1.705
diff -r1.705 erc.el
<   (cond
<    (tgt
<     (erc-log (format "erc-send-CTCP-notice: [%s] %s" tgt l))
<     (erc-send-command (format "NOTICE %s :\C-a%s\C-a" tgt l)
force))))
---
>   (let ((l (upcase l)))
>     (cond
>      (tgt
>       (erc-log (format "erc-send-CTCP-notice: [%s] %s" tgt l))
>       (erc-send-command (format "NOTICE %s :\C-a%s\C-a" tgt l) force)))))

--

-- 
I'm awfully glad I'm a Beta, because I don't work so hard.
(Continue reading)

Alex Schroeder | 12 Dec 2004 01:51
Face

Re: Re: supporting foreign characters in server messages

"It's me FKtPp ;)" <m_pupil <at> 163.com> writes:

> If you mind I post other mail on the gmane.emacs.erc.general Group?

You can post anywhere you want, as long as I get it.  :)  
Is gmane.emacs.erc.general redirected to 
erc-help <at> lists.sourceforge.net?

Otherwise use my wiki to post a note.

Alex.
--

-- 
.O.  http://www.emacswiki.org/alex/
..O  Schroeder's fifth law:
OOO  Never accept more work than you can handle in one night of hacking.

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
Hoan Ton-That | 13 Dec 2004 11:36

ERC logging bug

Hello,

If `erc-log-channels-directory' is set to a directory which contains
uppercase characters then logging will not work.  The function
`erc-current-logfile' downcases everything including the directory
part.  The following simple patch fixes this bug.

Attachment (diff): application/octet-stream, 2106 bytes
Adrian Aichner | 13 Dec 2004 19:30
X-Face
Picon
Favicon

Re: ERC logging bug

Hoan Ton-That <hoan <at> ton-that.org> writes:

> Hello,
>
> If `erc-log-channels-directory' is set to a directory which contains
> uppercase characters then logging will not work.  The function
> `erc-current-logfile' downcases everything including the directory
> part.  The following simple patch fixes this bug.

Hello Hoan, that explains the first hunk of your patch.

Why are you throwing out all these occurences of expand-file-name in
other functions which produce file paths based on
erc-log-channels-directory ?

Adrian

>
>
> --- erc-log.el~	2004-12-13 21:08:44.000000000 +1100
> +++ erc-log.el	2004-12-13 21:08:04.000000000 +1100
>  <at>  <at>  -269,20 +269,19  <at>  <at> 
>  If BUFFER is nil, the value of `current-buffer' is used.
>  This is determined by `erc-generate-log-file-name-function'.
>  The result is converted to lowercase, as IRC is case-insensitive"
> -  (downcase (expand-file-name
> -	     (funcall erc-generate-log-file-name-function
> +  (expand-file-name
> +   (downcase (funcall erc-generate-log-file-name-function
>  		      (or buffer (current-buffer))
(Continue reading)

disumu | 14 Dec 2004 08:05
Picon
Favicon

mode-line handling changed in erc.el revision 1.711

Hi all,

The last change made to `erc-mode-line-format' (in revision 1.706)
caused an error to occur in Xemacs when loading erc.el.  It can't/won't
handle #(" "...) strings.

I tried using `propertize' instead of strings like the one above, but
then some parts of the mode-line didn't work at all (for example, lots
of dashes were missing).  So I ended up making ERC work with the
existing mode-line, only changing the values of
`mode-line-buffer-identification' and `mode-line-process'.  That's the
way many other programs do things as well.

Note that if you've set `erc-mode-line-format' or
`erc-header-line-format' to something other than the default, you'll
need to change the value to a string that will work with
`format-spec'. The docstring for `erc-mode-line-format' has a list of
the characters which are replaced.

--
disumu

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/

Gmane