Gnus development mailing list
 help / color / mirror / Atom feed
* "Can't rfc2047-encode" error.
@ 2005-07-11 12:43 Maciej Matysiak
  2005-07-11 13:57 ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Maciej Matysiak @ 2005-07-11 12:43 UTC (permalink / raw)



I've subscribed to some RSS feeds recently and since then from time to time
I'm seeing this:

Can't rfc2047-encode `Przejściówka'
Retrieval complete.
nnrss: Requesting atari.new.allegro.pl...
nnrss: Requesting atari.end.allegro.pl...done
Retrieval complete.
Contacting allegro.pl:80
nnrss: Requesting atari.end.allegro.pl...
nnml: Reading incoming mail (14 new)...done

The word which can't be encoded contains some iso-8859-2 characters.

That error is not a big deal, but more annoying is that the number of messages
in my nnml groups isn't updated, so I have to blindly check if there are any
new messages.

Could this be corrected, please?

 m.m.
-- 
 use gnus, not guns!



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Can't rfc2047-encode" error.
  2005-07-11 12:43 "Can't rfc2047-encode" error Maciej Matysiak
@ 2005-07-11 13:57 ` Katsumi Yamaoka
  2005-08-04  9:18   ` Maciej Matysiak
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-07-11 13:57 UTC (permalink / raw)


>>>>> In <hhslylv7gv.fsf@blah.pl>
>>>>>	Maciej Matysiak <phoner.ding@blah.pl> wrote:

> I've subscribed to some RSS feeds recently and since then from time to time
> I'm seeing this:

> Can't rfc2047-encode `Przejściówka'
> Retrieval complete.
> nnrss: Requesting atari.new.allegro.pl...
> nnrss: Requesting atari.end.allegro.pl...done
> Retrieval complete.
> Contacting allegro.pl:80
> nnrss: Requesting atari.end.allegro.pl...
> nnml: Reading incoming mail (14 new)...done

> The word which can't be encoded contains some iso-8859-2 characters.

Isn't it an XEmacs issue?  I'm not quite sure of it since I
rarely see such characters, though.  But, in fact, XEmacs
21.4.17 encodes it properly in my system as follows:

(rfc2047-encode-string "Przejściówka")
 => "=?iso-8859-2?Q?Przej=B6ci=F3wka?="

(load "un-define")
(rfc2047-encode-string "Przejściówka")
 => "=?utf-8?B?UHJ6ZWrFm2Npw7N3a2E=?="



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Can't rfc2047-encode" error.
  2005-07-11 13:57 ` Katsumi Yamaoka
@ 2005-08-04  9:18   ` Maciej Matysiak
  2005-08-04 10:55     ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Maciej Matysiak @ 2005-08-04  9:18 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1415 bytes --]

On the 11th of July 2005 at 15:57, Katsumi Yamaoka <yamaoka#jpl.org> wrote:

>> I've subscribed to some RSS feeds recently and since then from time to time
>> I'm seeing this:
>
>> Can't rfc2047-encode `Przejściówka'
>> Retrieval complete.
>> nnrss: Requesting atari.new.allegro.pl...
>> nnrss: Requesting atari.end.allegro.pl...done
>> Retrieval complete.
>> Contacting allegro.pl:80
>> nnrss: Requesting atari.end.allegro.pl...
>> nnml: Reading incoming mail (14 new)...done
>
>> The word which can't be encoded contains some iso-8859-2 characters.
>
> Isn't it an XEmacs issue?  I'm not quite sure of it since I
> rarely see such characters, though.  But, in fact, XEmacs
> 21.4.17 encodes it properly in my system as follows:
>
> (rfc2047-encode-string "Przejściówka")
>  => "=?iso-8859-2?Q?Przej=B6ci=F3wka?="
>
> (load "un-define")
> (rfc2047-encode-string "Przejściówka")
>  => "=?utf-8?B?UHJ6ZWrFm2Npw7N3a2E=?="

[this is reply to quite old message, so full quote above]

It has just happened again. Now I set debug-on-error and saved
the buffer (attached). It seems, that there's problem with the "ó"
character, it's not encoded in iso-8859-2 like the rest of polish
characters in that word.

Anyways, I'd be really happy if gnus would update the number of
messages in each grup despite the rss error. Now it's just displays
"Can't rfc2047-encode ..." error and stops.

[-- Attachment #2: backtrace --]
[-- Type: text/plain, Size: 1371 bytes --]

Debugger entered--Lisp error: (error "Can't rfc2047-encode `Przej¶ci^[-Aówka'")^[-B
  signal(error ("Can't rfc2047-encode `Przej¶ci^[-Aówka'"))^[-B
  cerror("Can't rfc2047-encode `%s'" "Przej¶ci^[-Aówka")^[-B
  apply(cerror "Can't rfc2047-encode `%s'" "Przej¶ci^[-Aówka")^[-B
  error("Can't rfc2047-encode `%s'" "Przej¶ci^[-Aówka")^[-B
  rfc2047-encode(1 13)
  rfc2047-encode-region(1 42)
  nnrss-mime-encode-string("Przej¶ci^[-Aówka ST ---> VGA - z d^[-B¼wiêkiem!!!")
  nnrss-check-group("atari.new.allegro.pl" "")
  nnrss-request-group("atari.new.allegro.pl" "" nil)
  gnus-activate-group("nnrss:atari.new.allegro.pl" scan)
  gnus-get-unread-articles(nil)
  gnus-setup-news(nil nil nil)
  byte-code("..." [gnus-slave gnus-current-startup-file gnus-startup-file did-connect level dont-connect gnus-group-quit gnus-run-hooks gnus-startup-hook gnus-make-newsrc-file gnus-dribble-read-file gnus-request-create-group "queue" (nndraft "") "drafts" (nndraft "") gnus-setup-news nil gnus-setup-news-hook gnus-start-draft-setup gnus-group-list-groups gnus-group-first-unread-group gnus-configure-windows group gnus-group-set-mode-line gnus-started-hook gnus-use-dribble-file gnus-agent] 4)
  gnus-1(nil nil nil)
  gnus(nil)
  call-interactively(gnus)
  command-execute(gnus t)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

[-- Attachment #3: Type: text/plain, Size: 32 bytes --]


 m.m.
-- 
 use gnus, not guns!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Can't rfc2047-encode" error.
  2005-08-04  9:18   ` Maciej Matysiak
@ 2005-08-04 10:55     ` Katsumi Yamaoka
  2005-08-04 11:31       ` Maciej Matysiak
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-08-04 10:55 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 997 bytes --]

>>>>> In <hh64umnjqj.fsf@blah.pl> Maciej Matysiak wrote:

> It has just happened again. Now I set debug-on-error and saved
> the buffer (attached). It seems, that there's problem with the "ó"
> character, it's not encoded in iso-8859-2 like the rest of polish
> characters in that word.

(let ((mm-coding-system-priorities '(iso-8859-2)))
  (nnrss-mime-encode-string "ó"))
 => "=?iso-8859-2?Q?=F3?="

Hmm, there may be another real cause.  I think two or more
charsets were required to encode the text then.  In such a case,
the UTF-8 charset will be helpful.  Aren't you using the
Mule-UCS XEmacs package?

> Debugger entered--Lisp error: (error "Can't rfc2047-encode `...

The text in question seems to have been modified by the debugger
or something.

> Anyways, I'd be really happy if gnus would update the number of
> messages in each grup despite the rss error. Now it's just displays
> "Can't rfc2047-encode ..." error and stops.

This is a last resort, though.


[-- Attachment #2: Type: text/x-patch, Size: 504 bytes --]

--- nnrss.el~	2005-07-05 22:36:17 +0000
+++ nnrss.el	2005-08-04 10:54:28 +0000
@@ -518,7 +518,10 @@
     (delete-region (point) (point-max))
     (let ((rfc2047-encoding-type 'mime)
 	  rfc2047-encode-max-chars)
-      (rfc2047-encode-region (point-min) (point-max)))
+      (condition-case nil
+	  (rfc2047-encode-region (point-min) (point-max))
+	(error
+	 (delete-region (point-min) (point-max)))))
     (goto-char (point-min))
     (while (search-forward "\n" nil t)
       (delete-backward-char 1))

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Can't rfc2047-encode" error.
  2005-08-04 10:55     ` Katsumi Yamaoka
@ 2005-08-04 11:31       ` Maciej Matysiak
  2005-08-04 12:30         ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Maciej Matysiak @ 2005-08-04 11:31 UTC (permalink / raw)


On the 4th of August 2005 at 12:55, Katsumi Yamaoka <yamaoka#jpl.org> wrote:

> (let ((mm-coding-system-priorities '(iso-8859-2)))
>   (nnrss-mime-encode-string "ó"))
>  => "=?iso-8859-2?Q?=F3?="

And what is that "^[-A" before "ó" in that backtrace?

> Hmm, there may be another real cause.  I think two or more charsets were
> required to encode the text then.  In such a case, the UTF-8 charset will
> be helpful.

This feed is natively encoded with UTF-8:
<?xml version="1.0" encoding="utf-8"?>

> Aren't you using the Mule-UCS XEmacs package?

Yes, I am.

> -      (rfc2047-encode-region (point-min) (point-max)))
> +      (condition-case nil
> +	  (rfc2047-encode-region (point-min) (point-max))
> +	(error
> +	 (delete-region (point-min) (point-max)))))

That fixed the problem (I don't see the error anymore), but the message
in RSS group has empty subject. I can live with that :)

If you want to debug that further, the RSS feed is available at:
 http://allegro.pl//static/rss/55/new1/rss.rss
The problematic item has "item=59527061" in its url, you can search for
that string.

Thank you very much for help :)

 m.m.
-- 
 use gnus, not guns!



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Can't rfc2047-encode" error.
  2005-08-04 11:31       ` Maciej Matysiak
@ 2005-08-04 12:30         ` Katsumi Yamaoka
  2005-08-04 13:58           ` Maciej Matysiak
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-08-04 12:30 UTC (permalink / raw)


>>>>> In <hhk6j2vszp.fsf@blah.pl> Maciej Matysiak wrote:

> On the 4th of August 2005 at 12:55, Katsumi Yamaoka <yamaoka#jpl.org> wrote:

>> (let ((mm-coding-system-priorities '(iso-8859-2)))
>>   (nnrss-mime-encode-string "ó"))
>>  => "=?iso-8859-2?Q?=F3?="

> And what is that "^[-A" before "ó" in that backtrace?

I don't know but...

>> The text in question seems to have been modified by the debugger
>> or something.

> This feed is natively encoded with UTF-8:
> <?xml version="1.0" encoding="utf-8"?>

>> Aren't you using the Mule-UCS XEmacs package?

> Yes, I am.

I see.

>> +	 (delete-region (point-min) (point-max)))))

> That fixed the problem (I don't see the error anymore), but the message
> in RSS group has empty subject. I can live with that :)

I found a better solution than that.  Here it is:

(defadvice mm-find-mime-charset-region (after return-utf-8 activate)
  "Return `(utf-8)' even if other charsets are detected."
  (if (memq 'utf-8 ad-return-value)
      (setq ad-return-value '(utf-8))))

> If you want to debug that further, the RSS feed is available at:
>  http://allegro.pl//static/rss/55/new1/rss.rss
> The problematic item has "item=59527061" in its url, you can search for
> that string.

Thanks.  I've gotten the correct contents.  Now I suspect there's
a bug in the part for XEmacs of the mm-find-mime-charset-region
function.

(mm-with-multibyte-buffer
  (insert "Przejściówka ST ---&gt; VGA - z dźwiękiem!!!")
  (mm-find-mime-charset-region (point-min) (point-max)))

It should return `(utf-8)' but...



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Can't rfc2047-encode" error.
  2005-08-04 12:30         ` Katsumi Yamaoka
@ 2005-08-04 13:58           ` Maciej Matysiak
  2005-08-05  6:58             ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Maciej Matysiak @ 2005-08-04 13:58 UTC (permalink / raw)


On the 4th of August 2005 at 14:30, Katsumi Yamaoka <yamaoka#jpl.org> wrote:

> I found a better solution than that.

I'll try that later. Enough gnus restarts for today ;)

>> If you want to debug that further, the RSS feed is available at:
>>  http://allegro.pl//static/rss/55/new1/rss.rss
> Thanks.  I've gotten the correct contents.  Now I suspect there's
> a bug in the part for XEmacs of the mm-find-mime-charset-region
> function.
>
> (mm-with-multibyte-buffer
>   (insert "Przejściówka ST ---&gt; VGA - z dźwiękiem!!!")
>   (mm-find-mime-charset-region (point-min) (point-max)))
>
> It should return `(utf-8)' but...

...it returns "(utf-8 iso-8859-2)".

 m.m.
-- 
 use gnus, not guns!



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: "Can't rfc2047-encode" error.
  2005-08-04 13:58           ` Maciej Matysiak
@ 2005-08-05  6:58             ` Katsumi Yamaoka
  0 siblings, 0 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-08-05  6:58 UTC (permalink / raw)


>>>>> In <hh8xzhx0py.fsf@blah.pl> Maciej Matysiak wrote:

> On the 4th of August 2005 at 14:30, Katsumi Yamaoka <yamaoka#jpl.org> wrote:

>> (mm-with-multibyte-buffer
>>   (insert "Przejściówka ST ---&gt; VGA - z dźwiękiem!!!")
>>   (mm-find-mime-charset-region (point-min) (point-max)))
>>
>> It should return `(utf-8)' but...

> ...it returns "(utf-8 iso-8859-2)".

I've fixed it in the v5-10 branch and the trunk, though it is no
more than a thin veneer.  Now such errors should not occur in
XEmacs if the utf-8 coding system is available when not only
checking rss groups but also sending mails.  However, there's a
possibility with a problem that it tends to prefer utf-8 when
encoding messages.




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-08-05  6:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-11 12:43 "Can't rfc2047-encode" error Maciej Matysiak
2005-07-11 13:57 ` Katsumi Yamaoka
2005-08-04  9:18   ` Maciej Matysiak
2005-08-04 10:55     ` Katsumi Yamaoka
2005-08-04 11:31       ` Maciej Matysiak
2005-08-04 12:30         ` Katsumi Yamaoka
2005-08-04 13:58           ` Maciej Matysiak
2005-08-05  6:58             ` Katsumi Yamaoka

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 NNTP newsgroup(s).