Bug 465641

Summary: Wrong text encoding for file names in X11
Product: [I don't know] kde Reporter: Toby <tianer2820>
Component: generalAssignee: Unassigned bugs mailing-list <unassigned-bugs>
Status: RESOLVED NOT A BUG    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Toby 2023-02-12 21:14:39 UTC
SUMMARY

Chinese file names become random strings when using the "ls" command and in many other applications.
Looks like the encoding is wrong.

This only happens in X11, in Wayland, everything worked fine.
Many other applications are affected, such as LibreOffice and Python3. LibreOffice displays the file name on its title bar and it becomes a random string. The os.listdir() in Python3 also produce random strings.
I guess the system is making wrong assumptions about what encoding those applications use.


STEPS TO REPRODUCE
1. create a new folder, cd into it, create a new file named "测试.txt"
2. run ls ./


OBSERVED RESULT
the file name becomes "'��'$'\213''��'$'\225''.txt'"

EXPECTED RESULT
It should not become a random string

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 37
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8
Kernel Version: 6.1.10-200.fc37.x86_64 (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i5-9300HF CPU @ 2.40GHz
Memory: 7.7 GiB of RAM
Comment 1 Toby 2023-02-13 01:02:38 UTC
Turned out to be some per-user settings messed up the charmap. Solved after deleting all user config files.