]> code.delx.au - gnu-emacs/blobdiff - lisp/hexl.el
(display_tool_bar_line): Skip glyphs which are too big
[gnu-emacs] / lisp / hexl.el
index 1e724aa418ac82c6081816af9a22c79399b52c39..e2078fceecb6678a8a4baff26350fc2b0c0e5326 100644 (file)
@@ -704,7 +704,12 @@ This discards the buffer's undo information."
        (buffer-undo-list t))
     (apply 'call-process-region (point-min) (point-max)
           (expand-file-name hexl-program exec-directory)
-          t t nil (split-string hexl-options))
+          t t nil
+           ;; Manually encode the args, otherwise they're encoded using
+           ;; coding-system-for-write (i.e. buffer-file-coding-system) which
+           ;; may not be what we want (e.g. utf-16 on a non-utf-16 system).
+           (mapcar (lambda (s) (encode-coding-string s locale-coding-system))
+                   (split-string hexl-options)))
     (if (> (point) (hexl-address-to-marker hexl-max-address))
        (hexl-goto-address hexl-max-address))))