Bug 493905

Summary: QT warning "Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8." from helpers
Product: [Plasma] plasmashell Reporter: Steve Vialle <steve_v>
Component: Power management & brightnessAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: minor CC: bugs.kde.org, hanyoung, mihais23, natalie_clarius, nate, sitter, smowtenshi
Priority: NOR    
Version First Reported In: 6.1.5   
Target Milestone: 1.0   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Steve Vialle 2024-10-01 09:44:11 UTC
SUMMARY

dbus-daemon[4031]: [system] Activating service name='org.kde.powerdevil.discretegpuhelper' requested by ':1.28' (uid=1004 pid=6643 comm="/usr/libexec/org_kde_powerdevil") (using servicehelper)
org.kde.powerdevil.discretegpuhelper: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8. Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead. If this causes problems, reconfigure your locale. See the locale(1) manual for more information.
dbus-daemon[4031]: [system] Successfully activated service 'org.kde.powerdevil.discretegpuhelper'

dbus-daemon[4031]: [system] Activating service name='org.kde.powerdevil.chargethresholdhelper' requested by ':1.28' (uid=1004 pid=6643 comm="/usr/libexec/org_kde_powerdevil") (using servicehelper)
org.kde.powerdevil.chargethresholdhelper: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8. Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead. If this causes problems, reconfigure your locale. See the locale(1) manual for more information.
dbus-daemon[4031]: [system] Successfully activated service 'org.kde.powerdevil.chargethresholdhelper'

dbus-daemon[4031]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.28' (uid=1004 pid=6643 comm="/usr/libexec/org_kde_powerdevil") (using servicehelper)
Oct  1 22:02:48 localhost org.kde.powerdevil.backlighthelper: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8. Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead. If this causes problems, reconfigure your locale. See the locale(1) manual for more information.
dbus-daemon[4031]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'

STEPS TO REPRODUCE
1. Log into plasma? Buggered if I know.
 
OBSERVED RESULT
Warnings in syslog during plasma startup.

EXPECTED RESULT
No warnings in syslog during plasma startup.

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux 2.15
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.6.51-gentoo-dist (64-bit)
Graphics Platform: Wayland

ADDITIONAL INFORMATION

$ locale
LANG=en_NZ.UTF-8
LC_CTYPE="en_NZ.UTF-8"
LC_NUMERIC="en_NZ.UTF-8"
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_NZ.UTF-8"
LC_MONETARY="en_NZ.UTF-8"
LC_MESSAGES="en_NZ.UTF-8"
LC_PAPER="en_NZ.UTF-8"
LC_NAME="en_NZ.UTF-8"
LC_ADDRESS="en_NZ.UTF-8"
LC_TELEPHONE="en_NZ.UTF-8"
LC_MEASUREMENT="en_NZ.UTF-8"
LC_IDENTIFICATION="en_NZ.UTF-8"
LC_ALL=

$ locale -a
C
C.utf8
en_GB
en_GB.utf8
en_NZ
en_NZ.utf8
en_US
en_US.utf8
POSIX

# cat /proc/$(pgrep -f org_kde_powerdevil)/environ | strings | grep -E "LANG|LC_"
LANG=en_NZ.UTF-8
LC_TIME=en_GB.UTF-8
LANGUAGE=en_GB:en_US
Comment 1 Nate Graham 2025-05-27 20:07:47 UTC
IIRC this was fixed later in Plasma 6.3. Can you upgrade and see if it goes away?
Comment 2 Colin S 2025-05-27 21:27:33 UTC
On Plasma 6.3.4, I can confirm this issue.

KDE Plasma Version: 6.3.4
KDE Frameworks Version: 6.13.0
Qt Version: 6.8.2

```
[…]
org.kde.kded.smart[2748]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                               Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                               If this causes problems, reconfigure your locale. See the locale(1) manual
                                               for more information.
[…]
org.kde.powerdevil.discretegpuhelper[2888]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                                            Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                                            If this causes problems, reconfigure your locale. See the locale(1) manual
                                                            for more information.
dbus-daemon[1747]: [system] Successfully activated service 'org.kde.powerdevil.discretegpuhelper'
dbus-daemon[1747]: [system] Activating service name='org.kde.powerdevil.chargethresholdhelper' requested by ':1.60' (uid=x pid=2660 comm="/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdev") (using servicehelper)
org.kde.powerdevil.chargethresholdhelper[2895]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                                                Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                                                If this causes problems, reconfigure your locale. See the locale(1) manual
                                                                for more information.
dbus-daemon[1747]: [system] Successfully activated service 'org.kde.powerdevil.chargethresholdhelper'
dbus-daemon[1747]: [system] Activating service name='org.kde.powerdevil.backlighthelper' requested by ':1.60' (uid=x pid=2660 comm="/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdev") (using servicehelper)
org.kde.powerdevil.backlighthelper[2904]: Detected locale "C" with character encoding "ANSI_X3.4-1968", which is not UTF-8.
                                                               Qt depends on a UTF-8 locale, and has switched to "C.UTF-8" instead.
                                                               If this causes problems, reconfigure your locale. See the locale(1) manual
                                                               for more information.
dbus-daemon[1747]: [system] Successfully activated service 'org.kde.powerdevil.backlighthelper'
```

As with the OP I am not noticing any bare C locale in output of `locale`, nor in `localectl`, nor in the environ strings of the implicated helper process.

Some earlier version of Plasma did fill my `~/.config/plasma-localerc` with a lot of C locales which caused this warning to appear for all user processes (the related bug #438290 tracks missing "C.UTF-8" option in the kcm) but after fixing that, these warnings still appear in the helper processes.

Let me know what other information I can provide. Thanks!
Comment 3 Nate Graham 2025-05-28 17:14:18 UTC
OK, thanks!
Comment 4 Nate Graham 2025-10-03 16:37:49 UTC
The C.UTF-8 locale would need to be applied systemwide. Once it is, this should stop happening. I think that *effectively* makes this a duplicate of Bug 438290.

*** This bug has been marked as a duplicate of bug 438290 ***