Keyboard still gives me en_UK.UTF-8 characters even though I have set both $LANG and $GDM_LANG en_US.UTF-8

When I try to type the pipe or ‘vertical bar’ symbol ‘|’ I get ‘~’.

This is only one of many examples - see Appendix below for more - which show that the kernel has incorrectly read my keystrokes as if my keyboard was of the UK variety (en_UK.UTF-8) rather than the US variety (en_US.UTF-8).

Even though I have added the following:

GDM_LANG=en_US.UTF-8
LANG=en_US.UTF-8

… to $HOME/.bashrc and even though the ‘env’ command shows me that both those environment variables are both now correctly set to en_US.UTF-8, my keyboard still gives me UK characters as shown below in the Appendix.

Can anybody advise me how to fix this or, if not, how to further diagnose this problem?

Thank you for your attention.

APPENDIX: incorrect UK character output from my keyboard

without shift key pressed

`1234567890-=#
qwertyuiop[]
asdfghjkl;’
zxcvbnm,./

with shift key pressed
¬!"£$%^&*()_+~
QWERTYUIOP{}
ASDFGHJKL:@
ZXCVBNM<>

Check through this, I’m sure you will find a fix.
https://wiki.archlinux.org/title/locale

Apple keyboard?

Choose another layout - preferably a layout which matches your actual keymap

1 Like