* `gnus-face-from-file' encoding issues
@ 2003-04-17 1:33 Marshall T. Vandegrift
2003-04-27 2:58 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 2+ messages in thread
From: Marshall T. Vandegrift @ 2003-04-17 1:33 UTC (permalink / raw)
[-- Attachment #1.1: Type: text/plain, Size: 544 bytes --]
Hi,
I was experiencing a problem where `gnus-face-from-file' was creating
invalid PNG images. I tracked the problem down to my use of
`prefer-coding-system' to give highest priority to a multibyte coding
system. Apparently `mm-with-unibyte-buffer' isn't sufficient when a
string inserted into it has already been decoded from its source as
multibyte. My solution was to specify `coding-system-for-read' as
`binary' for the call to `gnus-shell-command-to-string', and I have
attached a patch to that effect (against ognus-0.18).
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: patch for gnus-fun.el --]
[-- Type: text/x-patch, Size: 743 bytes --]
--- ognus-0.18/lisp/gnus-fun.el 2003-03-31 12:49:14.000000000 -0500
+++ ognus-0.18-patched/lisp/gnus-fun.el 2003-04-16 21:12:03.000000000 -0400
@@ -107,10 +107,11 @@
(while (and (not done)
(> quant 1))
(setq attempt
- (gnus-shell-command-to-string
- (format gnus-convert-image-to-face-command
- (shell-quote-argument (expand-file-name file))
- quant)))
+ (let ((coding-system-for-read 'binary))
+ (gnus-shell-command-to-string
+ (format gnus-convert-image-to-face-command
+ (shell-quote-argument (expand-file-name file))
+ quant))))
(if (> (length attempt) 740)
(progn
(setq quant (- quant 2))
[-- Attachment #1.3: Type: text/plain, Size: 213 bytes --]
--
Marshall T. Vandegrift <vandem2@rpi.edu>
This is the manner of noble souls: they do not want
to have anything for nothing; least of all, life.
-- Friedrich Nietzsche, /Thus Spoke Zarathustra/
[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: `gnus-face-from-file' encoding issues
2003-04-17 1:33 `gnus-face-from-file' encoding issues Marshall T. Vandegrift
@ 2003-04-27 2:58 ` Lars Magne Ingebrigtsen
0 siblings, 0 replies; 2+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-04-27 2:58 UTC (permalink / raw)
Marshall T. Vandegrift <vandem2@rpi.edu> writes:
> My solution was to specify `coding-system-for-read' as
> `binary' for the call to `gnus-shell-command-to-string', and I have
> attached a patch to that effect (against ognus-0.18).
Thanks for the patch; I've applied it to Oort Gnus v0.19 (i. e., CVS).
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-04-27 2:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-17 1:33 `gnus-face-from-file' encoding issues Marshall T. Vandegrift
2003-04-27 2:58 ` Lars Magne Ingebrigtsen
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).