diff lisp/mh-e/mh-utils.el @ 68131:b9b10fe7c97a

(mh-x-image-url-cache-canonicalize): Use url-hexify-string to remove special characters from filenames (closes SF #1396499).
author Bill Wohler <wohler@newt.com>
date Wed, 11 Jan 2006 08:58:02 +0000
parents 40429cab94e1
children 03bac2d0a4aa
line wrap: on
line diff
--- a/lisp/mh-e/mh-utils.el	Wed Jan 11 07:46:57 2006 +0000
+++ b/lisp/mh-e/mh-utils.el	Wed Jan 11 08:58:02 2006 +0000
@@ -1489,12 +1489,16 @@
 
 (defun mh-x-image-url-cache-canonicalize (url)
   "Canonicalize URL.
-Replace the ?/ character with a ?! character and append .png."
-   (format "%s/%s.png" mh-x-image-cache-directory
+Replace the ?/ character with a ?! character and append .png.
+Also replaces special characters with `url-hexify-string' since
+not all characters, such as :, are legal within Windows
+filenames. See URL `http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/naming_a_file.asp'."
+  (format "%s/%s.png" mh-x-image-cache-directory
+          (url-hexify-string
            (with-temp-buffer
              (insert url)
              (mh-replace-string "/" "!")
-             (buffer-string))))
+             (buffer-string)))))
 
 (defun mh-x-image-set-download-state (file data)
   "Setup a symbolic link from FILE to DATA."