* 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.
char *str = unquote_argument (p + strlen ("-error "));
if (!skiplf)
printf ("\n");
- fprintf (stderr, "*ERROR*: %s", str);
+ message (true, "*ERROR*: %s", str);
if (str[0])
skiplf = str[strlen (str) - 1] == '\n';
exit_status = EXIT_FAILURE;
;; 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