Locale and foot

I recently started seeing the following error when opening a new foot terminal in sway:

warning: foot: 'C' is not a UTF-8 locale, falling back to 'C.UTF-8'

The Codeberg issue I found said that I was using a locale that wasn’t UTF-8 but I think I am doing everything right. Any ideas?

❮ cat /etc/locale.conf
#  File generated by update-locale
LANG=en_US.UTF-8

❮ locale --all-locales
C
C.utf8
en_GB.utf8
en_US.utf8
POSIX

❮ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Any ideas what to look out for? I ran sudo dpkg-reconfigure locales again; I ran sudo update-locale and now I’m out of ideas.

I suspect that when sway starts, its environment doesn’t have LANG set?

❮ grep env .config/sway/config
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP=sway

Anyway, any help appreciated.

I haven’t figured out what caused this change so now I’m working around it in my Sway config file:

# set LANG when calling foot to silence the following warning
# foot: 'C' is not a UTF-8 locale, falling back to 'C.UTF-8'
set $term env LANG=en_GB.UTF8 /usr/bin/foot;