Problem with locale in terminal

Hello everyone,

I have a problem with Czech characters (such as ěščřž...) not showing in terminal. I have been able to solve this problem by setting the Region locale in Plasma to Czech - after that I am able to write the characters in the terminal - but I also get some weird English/Czech/something mutation of my system; something is translated and something remains in English, which bothers me. I would prefer to use whole system in English, but also to be able to write Czech characters into the terminal.

This is a problem for me when using apps like WeeChat to provide support on our community IRC, when someone writes a message with diacritics, it is sometimes really hard to read.

inxi

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "",
        LC_ALL = (unset),
        LC_ADDRESS = "cs_CZ.UTF-8",
        LC_NAME = "cs_CZ.UTF-8",
        LC_MONETARY = "cs_CZ.UTF-8",
        LC_PAPER = "cs_CZ.UTF-8",
        LC_IDENTIFICATION = "cs_CZ.UTF-8",
        LC_TELEPHONE = "cs_CZ.UTF-8",
        LC_MEASUREMENT = "cs_CZ.UTF-8",
        LC_TIME = "cs_CZ.UTF-8",
        LC_NUMERIC = "cs_CZ.UTF-8",
        LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
System:
  Kernel: 5.17.3-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
    root=UUID=21c7fde8-1bef-4f82-abc8-364dad2d6848 rw [email protected]
    quiet splash rd.udev.log_priority=3 vt.global_cursor_default=0
    systemd.unified_cgroup_hierarchy=1
    resume=UUID=59131e58-a432-49f0-bae1-aebf3325230e loglevel=3
  Desktop: Tabby info: latte-dock wm: kwin_x11 dm: SDDM
    Distro: Garuda Linux base: Arch Linux
Machine:
  Type: Laptop System: HP product: OMEN by HP Laptop 15-dc1xxx v: N/A
    serial: <filter> Chassis: type: 10 serial: <filter>
  Mobo: HP model: 8574 v: 21.17 serial: <filter> UEFI: AMI v: F.22
    date: 05/03/2021
Battery:
  ID-1: BAT0 charge: 57.7 Wh (100.0%) condition: 57.7/57.7 Wh (100.0%)
    volts: 17.4 min: 15.4 model: HP Primary type: Li-ion serial: N/A
    status: full
CPU:
  Info: model: Intel Core i7-9750H socket: BGA1440 (U3E1) note: check
    bits: 64 type: MT MCP arch: Coffee Lake family: 6 model-id: 0x9E (158)
    stepping: 0xD (13) microcode: 0xEC
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 12 MiB desc: 1x12 MiB
  Speed (MHz): avg: 4087 high: 4100 min/max: 800/4500 base/boost: 3960/8300
    scaling: driver: intel_pstate governor: performance volts: 1.1 V
    ext-clock: 100 MHz cores: 1: 4082 2: 4078 3: 4100 4: 4087 5: 4097 6: 4086
    7: 4084 8: 4093 9: 4097 10: 4096 11: 4100 12: 4053 bogomips: 62399
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2
    mitigation: Enhanced IBRS, IBPB: conditional, RSB filling
  Type: srbds mitigation: TSX disabled
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: NVIDIA TU106M [GeForce RTX 2060 Mobile] vendor: Hewlett-Packard
    driver: nvidia v: 510.60.02 alternate: nouveau,nvidia_drm pcie: gen: 1
    speed: 2.5 GT/s lanes: 8 link-max: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 01:00.0 chip-ID: 10de:1f11 class-ID: 0300
  Device-2: Lite-On HP Wide Vision HD Camera type: USB driver: uvcvideo
    bus-ID: 1-6:3 chip-ID: 04ca:707f class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 21.1.3 with: Xwayland v: 22.1.1
    compositors: 1: kwin_x11 2: Tabby driver: X: loaded: nvidia gpu: nvidia
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 143 s-size: 341x191mm (13.43x7.52")
    s-diag: 391mm (15.39")
  Monitor-1: DP-2 res: 1920x1080 hz: 60 dpi: 142
    size: 344x194mm (13.54x7.64") diag: 395mm (15.55") modes: N/A
  OpenGL: renderer: NVIDIA GeForce RTX 2060/PCIe/SSE2
    v: 4.6.0 NVIDIA 510.60.02 direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel
    alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3
    chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA TU106 High Definition Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 8
    link-max: lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:10f9 class-ID: 0403
  Sound Server-1: ALSA v: k5.17.3-zen1-1-zen running: yes
  Sound Server-2: PulseAudio v: 15.0 running: no
  Sound Server-3: PipeWire v: 0.3.50 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 3c:00.0 chip-ID: 10ec:8168
    class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Intel Wi-Fi 6 AX200 driver: iwlwifi v: kernel pcie: gen: 2
    speed: 5 GT/s lanes: 1 bus-ID: 3d:00.0 chip-ID: 8086:2723 class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  IF-ID-1: tailscale0 state: unknown speed: 10 Mbps duplex: full mac: N/A
Bluetooth:
  Device-1: Intel AX200 Bluetooth type: USB driver: btusb v: 0.8
    bus-ID: 1-7:4 chip-ID: 8087:0029 class-ID: e001
  Report: bt-adapter ID: hci0 rfk-id: 0 state: up address: <filter>
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci
    v: 3.0 port: 5020 bus-ID: 00:17.0 chip-ID: 8086:282a rev: N/A
    class-ID: 0104
Drives:
  Local Storage: total: 1.84 TiB used: 58.31 GiB (3.1%)
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung
    model: MZVLB1T0HBLR-000H1 size: 953.87 GiB block-size: physical: 512 B
    logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter>
    rev: HPS0NEXF temp: 48.9 C scheme: GPT
  SMART: yes health: PASSED on: 210d 11h cycles: 807
    read-units: 47,235,252 [24.1 TB] written-units: 48,775,228 [24.9 TB]
  ID-2: /dev/sda maj-min: 8:0 vendor: Samsung model: SSD 870 EVO 1TB
    family: based SSDs size: 931.51 GiB block-size: physical: 512 B
    logical: 512 B sata: 3.3 speed: 6.0 Gb/s type: SSD serial: <filter>
    rev: 1B6Q temp: 37 C scheme: GPT
  SMART: yes state: enabled health: PASSED on: 196d 11h cycles: 474
    written: 2 TiB
Partition:
  ID-1: / raw-size: 896.9 GiB size: 896.9 GiB (100.00%)
    used: 58.31 GiB (6.5%) fs: btrfs block-size: 4096 B dev: /dev/sda2
    maj-min: 8:2
  ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.45%)
    used: 563 KiB (0.2%) fs: vfat block-size: 512 B dev: /dev/sda1 maj-min: 8:1
  ID-3: /home raw-size: 896.9 GiB size: 896.9 GiB (100.00%)
    used: 58.31 GiB (6.5%) fs: btrfs block-size: 4096 B dev: /dev/sda2
    maj-min: 8:2
  ID-4: /var/log raw-size: 896.9 GiB size: 896.9 GiB (100.00%)
    used: 58.31 GiB (6.5%) fs: btrfs block-size: 4096 B dev: /dev/sda2
    maj-min: 8:2
  ID-5: /var/tmp raw-size: 896.9 GiB size: 896.9 GiB (100.00%)
    used: 58.31 GiB (6.5%) fs: btrfs block-size: 4096 B dev: /dev/sda2
    maj-min: 8:2
Swap:
  Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 34.36 GiB used: 0 KiB (0.0%)
    priority: -2 dev: /dev/sda3 maj-min: 8:3
  ID-2: swap-2 type: zram size: 31.23 GiB used: 2.5 MiB (0.0%)
    priority: 100 dev: /dev/zram0
Sensors:
  System Temperatures: cpu: 79.0 C pch: 72.0 C mobo: N/A gpu: nvidia
    temp: 56 C
  Fan Speeds (RPM): cpu: 3802 fan-2: 3569
Info:
  Processes: 329 Uptime: 27m wakeups: 1 Memory: 31.23 GiB
  used: 4.98 GiB (15.9%) Init: systemd v: 250 tool: systemctl Compilers:
  gcc: 11.2.0 Packages: pacman: 1469 lib: 368 Shell: garuda-inxi (sudo)
  default: Bash v: 5.1.16 running-in: tabby inxi: 3.3.15
Garuda (2.6.1-1):
  System install date:     2021-07-24
  Last full system update: 2022-04-15
  Is partially upgraded:   No
  Relevant software:       NetworkManager
  Windows dual boot:       Yes
  Snapshots:               Timeshift
  Failed units

Thanks in advance for any help.

Your locale settings are uhmmmmm beyond screwed

Can you send the output of the command grep -v ^\# /etc/locale.{gen,conf} here?

And another question: Do you want your system in Czech or do you want your system in English, but allowing Czech characters?

3 Likes

Here it is:

/etc/locale.gen:cs_CZ.UTF-8 UTF-8
/etc/locale.gen:cs_CZ ISO-8859-2
/etc/locale.conf:LANG=en_GB.UTF-8
/etc/locale.conf:LC_ADDRESS=cs_CZ.UTF-8
/etc/locale.conf:LC_IDENTIFICATION=cs_CZ.UTF-8
/etc/locale.conf:LC_MEASUREMENT=cs_CZ.UTF-8
/etc/locale.conf:LC_MONETARY=cs_CZ.UTF-8
/etc/locale.conf:LC_NAME=cs_CZ.UTF-8
/etc/locale.conf:LC_NUMERIC=cs_CZ.UTF-8
/etc/locale.conf:LC_PAPER=cs_CZ.UTF-8
/etc/locale.conf:LC_TELEPHONE=cs_CZ.UTF-8
/etc/locale.conf:LC_TIME=cs_CZ.UTF-8

I prefer to display units, time / date format etc. in my native language, maybe this is why it got screwed?

As for your question, I would like to continue using my system in English, but allowing Czech characters in the terminal, as I said - the main problem is when I am on the IRC and the characters don't get decoded properly, instead showing ?? ?? .

First, run sudo bash to enter a root bash session. Then execute the following commands:

echo -e "cs_CZ.UTF-8 UTF-8\nen_US.UTF-8 UTF-8\nen_GB.UTF-8 UTF-8" > /etc/locale.gen
locale-gen

That should fix your language settings for now. Reboot and check if your system is still in franken-english or not for me please.

6 Likes

@TNE
That did it!

Thank you very much for helping me with this, it was starting to slowly drive me crazy. :slight_smile:

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.