I am having trouble getting certain AUR and flatpak apps to run with UTF-8 characters. Anki reports Anki requires a UTF-8 locale. Please Google 'how to change locale on [your Linux distro]', and MusicBee (via Wine) cannot read files with UTF-8 characters in their names.
Originally these were only an issue when launching the apps normally (double clicking a .desktop in dolphin, or launching via the KDE application launcher). When I would launch the apps via bash (Konsole) there would be no issues. Even running a shell script to launch the desktop file would work via Konsole but not via Dolphin. However I recently removed some extraneous (I thought) locale definitions from my .bashrc, and now neither work.
As far as I can tell, my locales are set and generated as I would want, with the right lines uncommented from /etc/locale.gen:
What is that you want, if I am not intrusive?
Do you need ISO-* locales for some reason?
Locale configuration is done according to technical considerations. What do you want to achieve?
I doubt this is true, if in the meantime you have not modified other settings/files.
And now, the real question:
What session are you running? (Maybe some Plasma/KDE?)
env | grep -iE "xdg_(current|session)_desktop"
systemctl show-environment | grep LANG
systemctl show-environment --user | grep LANG
I purely want to run programs with unicode characters without errors. Them being set as I want is referring to my locale.conf being all en_GB and it being generated.
Then you must disable the ISO* locales in locale.gen and regenerate locales.
And, yes, it’s KDE!
Your system locale is correctly set, but KDE does not have the same settings. Go in System Settings Locale/Language (whatever) and set the same (UTF-8) locales.
Reboot to see differences.
Followup questions- What did it change in my files to re-set the location setting to what it was displayed as being already set as (British English), and restart? It doesn’t appear to have changed my .bashrc, nor locale.conf. It seems like my .bashrc solution which I reverted only solved the issue when launching via bash, so does launching via the desktop bypass that?
In Settings > Region & Language > Language it was listed as “British English”. I clicked modify and selected “British English”, it prompted me to restart. Now the problem is gone. All programs behave as expected. However, looking in my /etc/locale.conf, everything is exactly as I showed above, and nothing has been added to my ~/.bashrc. What did the settings change on my system then?
As for my previous bashrc content that was fixing the programs but only when launched via commandline, I am sure I added it myself a long time ago when trying to set up fcitx or similar. Is there a place to put options like that which applies to programs launched outside of commandline (i.e. double clicking in kate or running via app launcher)?
This writes/modifies some KDE-related files in ~/.config/, as these are what KDE is using (user session), instead of system settings. Check modification timestamps to confirm what was changed.
It depends on the options and what you are trying to do (apps, features, etc.).
For command-line programs, you can use .bashrc, or other (.profile, etc.) to add commands/EnvVars.
For desktop launched apps in KDE, you have to follow the KDE way (System Settings, or some addon). It also depends on the specific task.