From 467af178f53798e4cd102e04eb2990121eb655df Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 31 May 2015 20:04:05 -0700 Subject: Treat batch stdout/stderr like standard display Calls like (print FOO) could generate improperly encoded or hard-to-read output if FOO contains characters outside the system locale. Fix this by treating batch stdout and stderr like interactive standard display, when it comes to transliterating and encoding characters (Bug#20545). * doc/emacs/mule.texi (Communication Coding): * doc/lispref/display.texi (Active Display Table): * doc/lispref/nonascii.texi (Locales): * etc/NEWS: * src/coding.c (syms_of_coding): * src/dispnew.c (syms_of_display): Document this. * src/print.c: Include disptab.h. (printchar_to_stream): New function, with much of the guts of the old Fexternal_debugging_output, except this one also uses the standard display table. (printchar, strout, Fexternal_debugging_output): Use it. --- src/coding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/coding.c') diff --git a/src/coding.c b/src/coding.c index 776ecac62d9..9342c3841f6 100644 --- a/src/coding.c +++ b/src/coding.c @@ -11121,7 +11121,8 @@ See also the function `find-operation-coding-system'. */); DEFVAR_LISP ("locale-coding-system", Vlocale_coding_system, doc: /* Coding system to use with system messages. -Also used for decoding keyboard input on X Window system. */); +Also used for decoding keyboard input on X Window system, and for +encoding standard output and error streams. */); Vlocale_coding_system = Qnil; /* The eol mnemonics are reset in startup.el system-dependently. */ -- cgit v1.2.1