Tuesday, December 23, 2025

macos – Why is my LANG=en_US@rg=fizzzz and what can I do about it?

I have a brand new Mac Mini and I set it up to use English as its system language, but I am physically in Finland and so set up some things like dictation and keyboard layout to use local conventions, and it seems it also configured date formats and measurement units for European (that is, international, non-US) preferences.

Superficially, I guess that explains the weird locale, but why does it set it to this value, is it supported in standards, and where exactly does it get set?

In my shell, (for which I still prefer Bash, out of Homebrew)

$ echo "$LANG"

returns nothing out of the box; but when I installed Emacs and ran it, I got

$ emacs &
[1] 7220
$ LANG=en_US@rg=fizzzz.UTF-8 cannot be used, using en_US.UTF-8 instead.

(This is Emacs 30.2 installed via Homebrew. Since LANG isn’t actually set, I’m guessing it synthesizes the value from … somewhere else.)

I came across https://www.alansiu.net/2024/06/01/getting-the-macos-selected-region-via-command-line/ which contains some information around this; indeed, if I check the defaults output I get precisely the value Emacs is complaining about, except it lacks the character set part;

$ defaults read -g AppleLocale
en_US@rg=fizzzz

I created a .bash_profile with

export LANG=en_US.UTF-8

and that fixed the immediate problem for things I run from the shell; but many applications are started from the GUI, and will not obey this setting. Is there somewhere else I can set it so that it is really system-wide?

Also, more broadly, what’s with Apple’s weird locales? In particular, what’s the significance of the zzzz part? Why is it there; does it mean something?

I have come across similar problems in the past where Linux systems would complain when my LANG or LC_ALL contained a value which wasn’t palatable to the remote system. Does that mean the values Apple configures are wrong, or does it mean that the remote Linux system doesn’t support values which are correct?

(For example, I remember seeing debates over whether the character set portion should be .utf8 or .UTF-8 where IIRC Apple permits the former where Linux requires the latter. Also, I know that many Linux admins only run locale-gen for the locales they acutely care about, and so whatever a remote user might prefer is not necessarily supported on their system even if it would be easy for the admin to just add it, if it is a standard locale.)

For what it’s worth, the Terminal configuration has “Set locale environment variables on startup” checked, out of the box. The OS version is a fresh install of Sequoia (15.6.1). (Well, I guess it installed plain 15.6 but then upgraded it as soon as I set up the system.)

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles