> From: Gavin Smith <[email protected]>
> Date: Thu, 22 Jan 2026 21:35:20 +0000
> Cc: [email protected]
> 
> On Thu, Jan 22, 2026 at 03:19:08PM +0200, Eli Zaretskii wrote:
> > Thanks, this seems to work well in my testing (I paged through the
> > ELisp manual, which uses Unicode characters).  "make check" also
> > succeeds if I add "raw-utf8-output=On" to info/t/config/texinfo/infokey.
> > 
> > I was thinking of turning this on by default if nl_langinfo returns
> > "UTF-8".  WDYT?
> 
> Here's code you could try in pcterm.c:
> 
> diff --git a/info/pcterm.c b/info/pcterm.c
> index bfba58fdda..720ac9b5ad 100644
> --- a/info/pcterm.c
> +++ b/info/pcterm.c
> @@ -831,7 +831,11 @@ rpl_nl_langinfo (nl_item item)
>  
>        /* The rest of the code wants to see "UTF-8" and nothing else.  */
>        if (console_cp == CP_UTF8)
> -       memcpy (buf, "UTF-8", sizeof "UTF-8");
> +        {
> +         memcpy (buf, "UTF-8", sizeof "UTF-8");
> +         VARIABLE_ALIST *raw_utf8_var = variable_by_name ("raw-utf8-output");
> +         set_variable_to_value (raw_utf8_var, "On", SET_BY_DEFAULT);
> +        }
>        else if (console_cp == CP_UTF7)
>         sprintf (buf, "CP%u", console_cp);
>        else
> 
> 
> The third argument to 'set_variable_to_value' is a priority level (the
> lowest possible) which allows the user to override the value.

Thanks, this works very well, and the tests still all pass, both with
and without activating this option, and both with UTF-8 and non-UTF-8
encoding of the console output.

If you decide to install this, I think the manual needs to be updated
to the effect that this variable is On by default when the Windows
console's output encoding is UTF-8 (a.k.a. "codepage 65001").

Reply via email to