GNU bug report logs - #51832
Piping unicode text in `shell-command'

Previous Next

Package: emacs;

Reported by: Tor Kringeland <tor.a.s.kringeland <at> ntnu.no>

Date: Sun, 14 Nov 2021 07:06:02 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: tor.a.s.kringeland <at> ntnu.no, 51832 <at> debbugs.gnu.org, alan <at> idiocy.org
Subject: bug#51832: Piping unicode text in `shell-command'
Date: Sun, 14 Nov 2021 10:46:05 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> doesn't.  And that's the setting in Emacs for me.  It's correct that I
> am in Norway and that I'm using the English locale, but there's no such
> locale as en_NO.utf-8.
>
> Didn't Emacs on Macos recently get some locale-related changes?

It's this code, I guess, from 2016, so it's not recent:

  NSLocale *locale = [NSLocale currentLocale];

  NSTRACE ("ns_init_locale");

  @try
    {
      /* It seems macOS should probably use UTF-8 everywhere.
         'localeIdentifier' does not specify the encoding, and I can't
         find any way to get the OS to tell us which encoding to use,
         so hard-code '.UTF-8'.  */
      NSString *localeID = [NSString stringWithFormat:@"%@.UTF-8",
                                     [locale localeIdentifier]];

      /* Set LANG to locale, but not if LANG is already set.  */
      setenv("LANG", [localeID UTF8String], 0);
    }

And...  it's a Macos bug?  Googling a bit seems to say that this does
indeed return invalid locale identifiers -- just language glued together
with the country, resulting in identifiers that doesn't match any
locales the OS knows about.

So...  I don't know what to do about that.  Is there a way to check that
the identifier is valid?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 2 years and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.