Subject: Re: bug#20545: Transliterating curved to straight quotes in 8-bit environments

From: Eli Zaretskii <[email-masked]>
Date: Mon, 01 Jun 2015 17:31:42 +0300

> Date: Sun, 31 May 2015 20:06:16 -0700
> From: Paul Eggert <[email-masked]>
> CC: [email-masked]
> 
> In trying out a few new things I did run into a problem in batch mode, because 
> (print FOO) can generate improperly encoded output if FOO contains characters 
> outside the system locale.  For example, if the file t.el uses UTF-8 encoding 
> and contains this:
> 
> ;; -*- coding: utf-8 -*-
> (print "‘x’ “y” `z'")
> 
> and Emacs is in an 8-bit locale, the command 'emacs --batch -l t.el' will output 
> the string "‘x’ “y” `z'" to stdout in a UTF-8 encoding, which is an encoding 
> error for this environment.
> 
> Although this problem can occur with any non-ASCII character, diagnostics 
> containing curved quotes will make it more likely.  I installed the attached 
> patch to fix this, using the same technique for standard output that Emacs is 
> already using for standard display.

It sounds strange to use display tables for batch-mode output, but
maybe it's just a matter of getting used to.