Function: w32-dropped-file-to-url

w32-dropped-file-to-url is a byte-compiled function defined in w32-win.el.gz.

Signature

(w32-dropped-file-to-url FILE-NAME)

Source Code

;; Defined in /usr/src/emacs/lisp/term/w32-win.el.gz
(defun w32-dropped-file-to-url (file-name)
  (let ((f (if (eq system-type 'cygwin)
               (cygwin-convert-file-name-from-windows file-name t)
             (subst-char-in-string ?\\ ?/ file-name)))
        (coding (if (eq system-type 'windows-nt)
		    ;; Native w32 build pretends that its file names
		    ;; are encoded in UTF-8, and converts to the
		    ;; appropriate encoding internally.
		    'utf-8
		  (or file-name-coding-system
		      default-file-name-coding-system))))

    (setq file-name
          (mapconcat 'url-hexify-string
                     (split-string (encode-coding-string f coding)
                                   "/")
                     "/")))
  (concat
   (if (eq system-type 'cygwin)
       "file://"
     "file:")
   file-name))