diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-11-19 21:34:07 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-11-19 21:34:07 +0200 |
commit | 1682bd18f50ed2095b2162207603c6b8a3f0225f (patch) | |
tree | f0eda12f210d0403c916046add26c3855aa21cca /lisp/server.el | |
parent | 2ec39734ca03e075f2515f178ed789872e52f98f (diff) | |
download | emacs-1682bd18f50ed2095b2162207603c6b8a3f0225f.tar.gz |
Fix encoding and display of messages sent by server to emacsclient
* lisp/server.el (server-start): Use 'locale-coding-system' to
encode messages sent back to the client.
* lib-src/emacsclient.c (main): Print '-error' messages via
'message', not directly via 'fprintf'. This shows the error on
MS-Windows when the client is invoked as 'emacsclientw', since
stderr goes to the bit bucket in that case.
Diffstat (limited to 'lisp/server.el')
-rw-r--r-- | lisp/server.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/server.el b/lisp/server.el index 553890ce299..2973b783e64 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -717,7 +717,10 @@ server or call `\\[server-force-delete]' to forcibly disconnect it.")) ;; Those are decoded by server-process-filter according ;; to file-name-coding-system. Also don't get ;; confused by CRs since we don't quote them. - :coding 'raw-text-unix + ;; For encoding, we must use the locale's encoding, + ;; since emacsclient shows that verbatim on the + ;; console. + :coding (cons 'raw-text-unix locale-coding-system) ;; The other args depend on the kind of socket used. (if server-use-tcp (list :family 'ipv4 ;; We're not ready for IPv6 yet |