* bug#8744: 23.3.50; rcirc prints gibberish
@ 2011-05-27 17:21 Leo
2011-05-28 17:53 ` Deniz Dogan
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Leo @ 2011-05-27 17:21 UTC (permalink / raw)
To: 8744; +Cc: Ryan Yeske, Deniz Dogan
[-- Attachment #1: Type: text/plain, Size: 332 bytes --]
1. Emacs -q
2. M-x irc
3. find out your nick by typing /me
4. C-c C-q and input your nick there
5. In the popup buffer type any utf-8 chars such as ♩♫
You may see something similar to the attached screenshot.
GNU Emacs 23.3.50.1 (x86_64-apple-darwin10.7.0, Carbon Version 1.6.0
AppKit 1038.35) of 2011-05-27
[-- Attachment #2: rcirc-bug.png --]
[-- Type: image/png, Size: 9147 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: 23.3.50; rcirc prints gibberish
2011-05-27 17:21 bug#8744: 23.3.50; rcirc prints gibberish Leo
@ 2011-05-28 17:53 ` Deniz Dogan
2011-05-29 1:11 ` Leo
2011-05-29 14:04 ` Leo
2011-05-29 18:49 ` bug#8744: Also use detect-coding-string? Marco Pessotto
2 siblings, 1 reply; 12+ messages in thread
From: Deniz Dogan @ 2011-05-28 17:53 UTC (permalink / raw)
To: Leo; +Cc: 8744, Ryan Yeske
On 2011-05-27 19:21, Leo wrote:
> 1. Emacs -q
> 2. M-x irc
> 3. find out your nick by typing /me
> 4. C-c C-q and input your nick there
> 5. In the popup buffer type any utf-8 chars such as ♩♫
>
> You may see something similar to the attached screenshot.
>
> GNU Emacs 23.3.50.1 (x86_64-apple-darwin10.7.0, Carbon Version 1.6.0
> AppKit 1038.35) of 2011-05-27
>
For what it's worth, I cannot reproduce this on: GNU Emacs 24.0.50.1
(i386-mingw-nt6.1.7601) of 2011-05-16 on 3249CTO
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: 23.3.50; rcirc prints gibberish
2011-05-27 17:21 bug#8744: 23.3.50; rcirc prints gibberish Leo
2011-05-28 17:53 ` Deniz Dogan
@ 2011-05-29 14:04 ` Leo
2011-05-29 14:26 ` Leo
2011-05-29 18:49 ` bug#8744: Also use detect-coding-string? Marco Pessotto
2 siblings, 1 reply; 12+ messages in thread
From: Leo @ 2011-05-29 14:04 UTC (permalink / raw)
To: 8744; +Cc: Ryan Yeske
The culprit is this line in rcirc-print:
;; only decode text from other senders, not ours
(setq text (decode-coding-string text rcirc-decode-coding-system))
Any idea why not also decode message to ourselves?
Leo
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: 23.3.50; rcirc prints gibberish
2011-05-29 14:04 ` Leo
@ 2011-05-29 14:26 ` Leo
0 siblings, 0 replies; 12+ messages in thread
From: Leo @ 2011-05-29 14:26 UTC (permalink / raw)
To: 8744
On 2011-05-29 22:04 +0800, Leo wrote:
> The culprit is this line in rcirc-print:
>
> ;; only decode text from other senders, not ours
> (setq text (decode-coding-string text rcirc-decode-coding-system))
>
> Any idea why not also decode message to ourselves?
OK, found the reason. Will install the following patch soonish.
commit 0cd01fb856ec13223446cb77adf65a6b9867a455 (HEAD, refs/heads/leo-lisp-reader)
Date: Sun May 29 22:17:23 2011 +0800
Fix decoding issue for text to self in rcirc.el (#8744)
Decoding is required due to change on 2006-04-08 by Eli Zaretskii.
---
lisp/net/rcirc.el | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
Modified lisp/net/rcirc.el
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index cbcac886..8fb5a98a 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -1428,9 +1428,8 @@ (defun rcirc-print (process sender response target text &optional activity)
(old-point (point-marker))
(fill-start (marker-position rcirc-prompt-start-marker)))
+ (setq text (decode-coding-string text rcirc-decode-coding-system))
(unless (string= sender (rcirc-nick process))
- ;; only decode text from other senders, not ours
- (setq text (decode-coding-string text rcirc-decode-coding-system))
;; mark the line with overlay arrow
(unless (or (marker-position overlay-arrow-position)
(get-buffer-window (current-buffer))
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#8744: Also use detect-coding-string?
2011-05-27 17:21 bug#8744: 23.3.50; rcirc prints gibberish Leo
2011-05-28 17:53 ` Deniz Dogan
2011-05-29 14:04 ` Leo
@ 2011-05-29 18:49 ` Marco Pessotto
2011-05-30 2:39 ` Leo
2 siblings, 1 reply; 12+ messages in thread
From: Marco Pessotto @ 2011-05-29 18:49 UTC (permalink / raw)
To: 8744
Couldn't this patch be modified as:
index b9f92ff..fa8da53 100644
--- a/rcirc.el
+++ b/rcirc.el
@@ -1456,10 +1456,11 @@ record activity."
(let ((moving (= (point) rcirc-prompt-end-marker))
(old-point (point-marker))
(fill-start (marker-position rcirc-prompt-start-marker)))
-
+
+ (setq text
+ (decode-coding-string text (detect-coding-string text t)))
(unless (string= sender (rcirc-nick process))
- ;; only decode text from other senders, not ours
- (setq text (decode-coding-string text rcirc-decode-coding-system))
+
;; mark the line with overlay arrow
(unless (or (marker-position overlay-arrow-position)
(get-buffer-window (current-buffer))
I was annoyed by ppl mixing encodings on the same channel and this seems
to fix it.
--
Marco
^ permalink raw reply related [flat|nested] 12+ messages in thread
* bug#8744: Also use detect-coding-string?
2011-05-29 18:49 ` bug#8744: Also use detect-coding-string? Marco Pessotto
@ 2011-05-30 2:39 ` Leo
2011-05-30 6:42 ` Marco Pessotto
0 siblings, 1 reply; 12+ messages in thread
From: Leo @ 2011-05-30 2:39 UTC (permalink / raw)
To: Marco Pessotto; +Cc: 8744
On 2011-05-30 02:49 +0800, Marco Pessotto wrote:
> Couldn't this patch be modified as:
[snipped 23 lines]
I just read
http://en.wikipedia.org/wiki/Internet_Relay_Chat#Character_encoding, so
this seems to be a good change.
Stefan, what do you think?
Should I make the change so that if rcirc-decode-coding-system is a
coding-system, it is used, otherwise detect the coding-system?
Leo
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: Also use detect-coding-string?
2011-05-30 2:39 ` Leo
@ 2011-05-30 6:42 ` Marco Pessotto
2011-05-30 12:36 ` Leo
2011-05-30 13:33 ` Stefan Monnier
0 siblings, 2 replies; 12+ messages in thread
From: Marco Pessotto @ 2011-05-30 6:42 UTC (permalink / raw)
To: Leo; +Cc: 8744
Leo <sdl.web@gmail.com> writes:
> On 2011-05-30 02:49 +0800, Marco Pessotto wrote:
>> Couldn't this patch be modified as:
> [snipped 23 lines]
>
> I just read
> http://en.wikipedia.org/wiki/Internet_Relay_Chat#Character_encoding, so
> this seems to be a good change.
>
> Stefan, what do you think?
>
> Should I make the change so that if rcirc-decode-coding-system is a
> coding-system, it is used, otherwise detect the coding-system?
>
The rcirc-decode-coding-system is by default set to 'utf-8, which is
(obviously a valid coding system), so the test, if i understand
correctly, would always be true.
My idea is that the client should try to detect automatically the
encoding used for each message received, using as first choices the
encodings set by the user. That's what all the major IRC clients do (like
irssi and weechat).
Cheers
--
Marco
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: Also use detect-coding-string?
2011-05-30 6:42 ` Marco Pessotto
@ 2011-05-30 12:36 ` Leo
2011-05-30 13:33 ` Stefan Monnier
1 sibling, 0 replies; 12+ messages in thread
From: Leo @ 2011-05-30 12:36 UTC (permalink / raw)
To: Marco Pessotto; +Cc: 8744-done
Fixed in version 24.1.
Many thanks for the suggestion.
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: Also use detect-coding-string?
2011-05-30 6:42 ` Marco Pessotto
2011-05-30 12:36 ` Leo
@ 2011-05-30 13:33 ` Stefan Monnier
2011-05-30 14:18 ` Marco Pessotto
1 sibling, 1 reply; 12+ messages in thread
From: Stefan Monnier @ 2011-05-30 13:33 UTC (permalink / raw)
To: Marco Pessotto; +Cc: 8744, Leo
> The rcirc-decode-coding-system is by default set to 'utf-8, which is
> (obviously a valid coding system), so the test, if i understand
> correctly, would always be true.
> My idea is that the client should try to detect automatically the
> encoding used for each message received, using as first choices the
> encodings set by the user. That's what all the major IRC clients do (like
> irssi and weechat).
IIUC that's exactly what you'll get if you set
rcirc-decode-coding-system to `undecided'.
Stefan
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: Also use detect-coding-string?
2011-05-30 13:33 ` Stefan Monnier
@ 2011-05-30 14:18 ` Marco Pessotto
2011-05-31 3:16 ` Leo
0 siblings, 1 reply; 12+ messages in thread
From: Marco Pessotto @ 2011-05-30 14:18 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 8744, Leo
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> The rcirc-decode-coding-system is by default set to 'utf-8, which is
>> (obviously a valid coding system), so the test, if i understand
>> correctly, would always be true.
>
>> My idea is that the client should try to detect automatically the
>> encoding used for each message received, using as first choices the
>> encodings set by the user. That's what all the major IRC clients do (like
>> irssi and weechat).
>
> IIUC that's exactly what you'll get if you set
> rcirc-decode-coding-system to `undecided'.
>
>
> Stefan
I tested this a bit and you're right. A line of documentation wouldn't
harm, anyway. Something like:
@@ -302,7 +302,9 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
:group 'rcirc)
(defcustom rcirc-decode-coding-system 'utf-8
- "Coding system used to decode incoming irc messages."
+ "Coding system used to decode incoming irc messages.
+Set to 'undecided if you want the encoding of the incoming
+messages autodetected"
:type 'coding-system
:group 'rcirc)
Bests
--
Marco
^ permalink raw reply [flat|nested] 12+ messages in thread
* bug#8744: Also use detect-coding-string?
2011-05-30 14:18 ` Marco Pessotto
@ 2011-05-31 3:16 ` Leo
0 siblings, 0 replies; 12+ messages in thread
From: Leo @ 2011-05-31 3:16 UTC (permalink / raw)
To: 8744
On 2011-05-30 22:18 +0800, Marco Pessotto wrote:
>> IIUC that's exactly what you'll get if you set
>> rcirc-decode-coding-system to `undecided'.
>>
>>
>> Stefan
>
> I tested this a bit and you're right. A line of documentation wouldn't
> harm, anyway. Something like:
>
> @@ -302,7 +302,9 @@ Called with 5 arguments, PROCESS, SENDER, RESPONSE, TARGET and TEXT."
> :group 'rcirc)
>
> (defcustom rcirc-decode-coding-system 'utf-8
> - "Coding system used to decode incoming irc messages."
> + "Coding system used to decode incoming irc messages.
> +Set to 'undecided if you want the encoding of the incoming
> +messages autodetected"
> :type 'coding-system
> :group 'rcirc)
I was ignorant of this fact. I will revert my commit to my original
patch with the doc-string improvement from Marco in a day or two.
Leo
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2011-05-31 3:16 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-27 17:21 bug#8744: 23.3.50; rcirc prints gibberish Leo
2011-05-28 17:53 ` Deniz Dogan
2011-05-29 1:11 ` Leo
2011-05-29 14:04 ` Leo
2011-05-29 14:26 ` Leo
2011-05-29 18:49 ` bug#8744: Also use detect-coding-string? Marco Pessotto
2011-05-30 2:39 ` Leo
2011-05-30 6:42 ` Marco Pessotto
2011-05-30 12:36 ` Leo
2011-05-30 13:33 ` Stefan Monnier
2011-05-30 14:18 ` Marco Pessotto
2011-05-31 3:16 ` Leo
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).