Set coding-system-for-write when talking to ledger

Otherwise, calling out to Ledger uses whatever the user's default
happens to be, such as iso-latin-1.  This caused problems for one user
who had euro symbols encoding in utf-8 in his data file.
This commit is contained in:
John Wiegley 2009-02-13 05:02:37 -04:00
parent 60019dc4b4
commit 037dd0f716

View file

@ -1289,11 +1289,12 @@ This is done so that the last digit falls in COLUMN, which defaults to 52."
(t
(let ((buf (current-buffer)))
(with-current-buffer buffer
(apply #'call-process-region
(append (list (point-min) (point-max)
ledger-binary-path ledger-delete-after
buf nil "-f" "-")
args)))))))
(let ((coding-system-for-write 'utf-8))
(apply #'call-process-region
(append (list (point-min) (point-max)
ledger-binary-path ledger-delete-after
buf nil "-f" "-")
args))))))))
(defun ledger-run-ledger-and-delete (buffer &rest args)
(let ((ledger-delete-after t))