Bug 371582

Summary: [2.5.0] Wrong representation of files and paths with Russian names (ru_RU.UTF-8)
Product: [Applications] krusader Reporter: Sergey <energumenoster>
Component: generalAssignee: Krusader Bugs Distribution List <krusader-bugs-null>
Status: CLOSED FIXED    
Severity: normal CC: alex.bikadorov, andreas_barth, clearmartin, kde, krusader-bugs-null, nikita+kde
Priority: NOR    
Version: 2.5.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Wrong representation of non-English filenames and directories
A real screenshot from my Plasms 5 desktop
Log of emerge -1 kde-misc/krusader-2.5.0 from Portage

Description Sergey 2016-10-24 15:32:00 UTC
Created attachment 101745 [details]
Wrong representation of non-English filenames and directories

See picture what I have instead of normal Russian names in all non-English files and directories.
Comment 1 Sergey 2016-10-24 15:37:54 UTC
Comment on attachment 101745 [details]
Wrong representation of non-English filenames and directories

Wrong pic.
Comment 2 Sergey 2016-10-24 15:39:58 UTC
Sorry, I posted wrong picture from the other forum. In reality filenames are look like this: "����������".
Comment 3 Alex Bikadorov 2016-10-24 18:27:40 UTC
in the krarc:// protocol or in general?
Comment 4 Sergey 2016-10-24 19:01:19 UTC
In general. It's not relayted to archives. I've just migrated to 2.5.0 and suddenly started to see this problem. I'll give you a real screenshot, not a wrong copypaste from some forum which I thought did look like.
Comment 5 Sergey 2016-10-24 19:02:44 UTC
Created attachment 101750 [details]
A real screenshot from my Plasms 5 desktop
Comment 6 Sergey 2016-10-24 19:05:01 UTC
The output of locale is the following:
# locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC=C
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES=C
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
Comment 7 Alex Bikadorov 2016-10-24 19:14:20 UTC
cannot confirm. In Dolphin or Konqueror the files are displayed correctly?
Comment 8 Sergey 2016-10-24 20:11:58 UTC
In Konqueror and other browsers files are displayed correctly. They also were displayed correctly in 2.4.0_beta3-r2 version of Krusader. The only problem is with Krusader-2.5.0. The problem may also be related to fresh Gentoo ebuild of Krusader I have. IDK.
Comment 9 Sergey 2016-10-27 14:01:32 UTC
If I create file "Образец.txt" in some path in Krusader then it correctly displayed in KrViewer but on the right panel of Krusader I have "��������������.txt" instead of "Образец.txt".

Also, no problems with filenames in konsole-16.04.3 or in dolphin-16.04.3. The only problem is inside panels of krusader-2.5.0.
Comment 10 Martin Kostolný 2016-10-27 18:13:15 UTC
I also cannot replicate it. One silly question - sorry, just to be sure:
Do you have the ru_RU.UTF-8 locale actually generated (locale-gen)?

Next step - can you please try to manually compile it from cloned git repo? See the INSTALL file for details. That way we can decide if there is a problem with the ebuild.
Comment 11 Sergey 2016-10-27 19:16:01 UTC
# locale-gen
 * Generating locale-archive: forcing # of jobs to 1
 * Generating 6 locales (this might take a while) with 1 jobs
 *  (1/6) Generating en_US.ISO-8859-1 ...                                         [ ok ]
 *  (2/6) Generating en_US.UTF-8 ...                                              [ ok ]
 *  (3/6) Generating ru_RU.CP1251 ...                                             [ ok ]
 *  (4/6) Generating ru_RU.KOI8-R ...                                             [ ok ]
 *  (5/6) Generating ru_RU.UTF-8 ...                                              [ ok ]
 *  (6/6) Generating ru_RU.UTF-8 ...                                              [ ok ]
 * Generation complete

# locale -a
C
en_US
en_US.iso88591
en_US.utf8
POSIX
ru_RU
ru_RU.cp1251
ru_RU.koi8r
ru_RU.utf8

# eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   en_US
  [3]   en_US.iso88591
  [4]   en_US.utf8
  [5]   POSIX
  [6]   ru_RU
  [7]   ru_RU.cp1251
  [8]   ru_RU.koi8r
  [9]   ru_RU.utf8
  [10]  ru_RU.UTF-8 *
  [ ]   (free form)

# env-update && source /etc/profile
>>> Regenerating /etc/ld.so.cache...

# emerge -1 kde-misc/krusader

 * IMPORTANT: 1 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R   ~] kde-misc/krusader-2.5.0:5::gentoo  USE="handbook -debug" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

>>> Verifying ebuild manifests
>>> Emerging (1 of 1) kde-misc/krusader-2.5.0::gentoo
>>> Installing (1 of 1) kde-misc/krusader-2.5.0::gentoo
>>> Jobs: 1 of 1 complete                           Load avg: 2.79, 1.54, 1.10
>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

non-English files are still buggy after restart of Krusader.
Comment 12 Sergey 2016-10-27 19:21:28 UTC
Created attachment 101839 [details]
Log of emerge -1 kde-misc/krusader-2.5.0 from Portage
Comment 13 Sergey 2016-10-27 19:22:49 UTC
I will try manual install later.
Comment 14 Sergey 2016-11-25 08:16:28 UTC
I tried to execute krusader with changed language variables. If I run it with the following command:
LC_ALL=ru_RU.UTF-8 krusader
then all path/file names back no normal behaviour. But LC_ALL changes all language settings to Russian, not only file names, but also menu, descriptions, etc. which I don't want to change. It's better sometimes to get messages and other things in English. That's why I have the following set:
$ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC=C
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES=C
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
Executing krusader with LC_MESSAGES or LC_NUMERIC set to "ru_RU.UTF-8" doesn't help to solve strange symbols in names. It looks like krusader only knows LC_ALL and ignores other language variables.
Comment 15 Alex Bikadorov 2016-11-25 20:29:00 UTC
> It looks like krusader only knows LC_ALL and ignores other language variables.

That can't be it. My settings are:
$locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME=de_DE.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

But all filenames are fine - English, Russian, Japanese...

Do have regional settings set in KDEs "system settings"?
Comment 16 Sergey 2016-11-25 20:48:20 UTC
I have never been in this menu. According to my experience it's bad practice to interfere there. I set everything long time ago inside /etc/ and other configs. Also time zone is set in config files long time ago using console. Once I tried to change in KDE4 settings my time zone or other thing and it was bad experience. It broke my "console" settings. Also I don't change things which work well.

Well, in your example I see that "en_US.UTF-8" != "C".
Comment 17 Vadim Dyadkin 2017-01-06 15:47:20 UTC
I have the same issue. It also happens in smplayer.
Comment 18 Vadim Dyadkin 2017-01-06 16:42:02 UTC
I solved this issue for me. It is neither krusader not smplayer issue. The solution is for gentoo and based on this: https://bbs.archlinux.org/viewtopic.php?id=150732
What I did:
In /etc/locale I left only:

ru_RU.UTF-8 UTF-8
en_US.UTF-8 UTF-8

then 

locale-gen.

Then in /etc/env.d/02locale I set:

LANG="ru_RU.UTF-8"
LC_COLLATE="C"

then 
env-update && source /etc/profile && reboot

Do not use "eselect locale set" anymore, it breaks everything again. Hope it helps.
Comment 19 Vadim Dyadkin 2017-01-06 16:43:33 UTC
In /etc/locale.gen, of course
Comment 20 Alex Bikadorov 2017-02-22 14:56:04 UTC
Is it fixed now, or at least confirmed to be not Krusader related?
Comment 21 Vadim Dyadkin 2017-02-22 15:02:05 UTC
> Is it fixed now, or at least confirmed to be not Krusader related?

It is definitely not a Krusader issue, thus, I guess, yes, fixed.
Comment 22 Alex Bikadorov 2017-02-22 15:46:21 UTC
ok, thanks
Comment 23 Sergey 2017-02-22 15:50:47 UTC
Still the same issue with kde-misc/krusader-2.5.0-r2 in Gentoo.
Comment 24 Sergey 2017-02-22 15:52:33 UTC
# locale -a
C
POSIX
en_US.utf8
ru_RU
ru_RU.cp1251
ru_RU.koi8r
ru_RU.utf8
Comment 25 Alex Bikadorov 2017-02-22 15:54:47 UTC
ahh, so comment 18 does not help?
Comment 26 Sergey 2017-02-22 16:00:51 UTC
The comment above isn't suitable for me because I don't want to remove this locales from the system. No other problems with other KDE apps, only Krusader bug or may be smth else.
Comment 27 Sergey 2017-02-22 16:07:49 UTC
#cat /etc/locale.gen
en_US.UTF-8 UTF-8
ru_RU UTF-8
ru_RU.UTF-8 UTF-8
ru_RU.KOI8-R KOI8-R
ru_RU.CP1251 CP1251

# cat /etc/env.d/02locale 
LC_ALL=""
LANG="ru_RU.UTF-8"
LC_MESSAGES="C"
LC_NUMERIC="C"
LC_COLLATE="C"

# eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   POSIX
  [3]   en_US.utf8
  [4]   ru_RU
  [5]   ru_RU.cp1251
  [6]   ru_RU.koi8r
  [7]   ru_RU.utf8
  [8]   ru_RU.UTF-8 *
  [ ]   (free form)
Comment 28 Vadim Dyadkin 2017-02-22 16:08:32 UTC
(In reply to Sergey from comment #26)
> The comment above isn't suitable for me because I don't want to remove this
> locales from the system. No other problems with other KDE apps, only
> Krusader bug or may be smth else.

I had exactly the same bug with SMPlayer and all pure (non-KDE) Qt5 application, therefore it does not look to me as a Krusader issue. I was rather surprised that Krusader was also exposed. But the method I described solved this issue for all programs.
Comment 29 Sergey 2017-02-22 16:13:47 UTC
I use the following command to start Krusader ATM:
$ LC_ALL=en_US.UTF-8 krusader
There are no bugs with "����������" but dates and other things a bit not in accordance with Russian locale.
Comment 30 Sergey 2017-02-22 16:17:11 UTC
I don't use smplayer, only mpv or vlc directly. There are no such issues in other KDE apps like Konqueror for example.
Comment 31 Sergey 2017-02-22 16:19:44 UTC
kde-apps/konqueror-16.08.3 is installed there. It looks like it from :4 slot, not :5.
Comment 32 Sergey 2017-02-22 16:28:52 UTC
Maybe konqueror-16.08.3 does work well because it's qt4? But I also have for example media-video/subtitlecomposer-0.6.4:5 which is based on KDE Frameworks 5.29.0 and Qt 5.6.2 (built against 5.6.2) and I don't have any issues there with Open file dialog as well as inside Plasma 5 open file dialogs in any other apps like firefox or chromium.
Comment 33 liva 2017-07-19 19:53:44 UTC
*** Bug 382484 has been marked as a duplicate of this bug. ***
Comment 34 Martin Kostolný 2017-08-01 16:41:23 UTC
Until recently, everything worked just fine for me, but after a system update (not Krusader, although I did recompile it) I've started to see question marks in Krusader. Interestingly not in Dolphin, but more interestingly in Konsole was question marks, too. I believe I have properly installed Arch linux, so I have had only LANG=en_GB.UTF-8 in /etc/locale.conf. The question marks problem went away when I added this line in /etc/locale.conf:

LC_CTYPE=en_GB.UTF-8

I have no idea what have changed...
Comment 35 Christoph Feck 2017-08-24 00:24:12 UTC
This is probably https://github.com/systemd/systemd/issues/6407 (as researched in a similar Konsole bug 382824).
Comment 36 Sergey 2017-08-24 10:10:04 UTC
Systemd issue above is unrelated (I have only openrc here). Also I have no problems with Konsole. It's only the Krusader bug.
Comment 37 supernobby 2017-09-10 13:57:11 UTC
Hello! I also have this problem since some time with my Arch Linux installation and the current Krusader version. For me, I am Germany, the problem is with the German special chars. For 1 of the German special chars like 'ä', Krusader shows 2 of this '�' signs.
As far as I remember, the problem did not start with a Krusader update, but with other updates I don't remember now.
But I remember, that I also had this issue in the konsole. I could fix this by modifying the konsole profile advanced settings, by choosing a "Default character encoding" of "UTF-8". Unfortunately, Krusader has no such option.
So, for me it looks like, something changed regarding the default character encoding. As for the konsole, it probably got shifted away from UTF-8?!?
The interesting thing is, I still also have this issue in a root konsole, which I start from my user session with "sudo konsole". The konsole profile advanced settings "Default character encoding" there shows "US-ASCII", which is actually not option to "Select" in this dialog. So, strange, how it got there?!?
Dolphin is also ok. So yes, I suspect it is some sort of a Krusader issue, to not make it using UTF-8 encoding.
Comment 38 Martin Kostolný 2017-09-10 14:06:10 UTC
I'm on Arch and I've also noticed a change in locale behaviour. The issues with Konsole or Krusader got fixed for me when I set also LC_CTYPE in /etc/locale.conf. So now I have these two lines in /etc/locale.conf:
LANG=en_GB.UTF-8
LC_CTYPE=en_GB.UTF-8

...and the questionmark characters are gone for me.
Comment 39 supernobby 2017-09-10 14:29:43 UTC
Hi Martin!
thanks very much for the hint. I just tried it by added LC_CTYPE=de_DE.UTF-8 and indeed, the � are also gone for me. Cool!
Andreas
Comment 40 Nikita Melnichenko 2018-02-18 07:32:43 UTC
I was able to repro Sergey's issue:

user@host ~ $ export LANG=ru_RU.UTF-8
user@host ~ $ export LC_MESSAGES="C"
user@host ~ $ export LC_NUMERIC="C"
user@host ~ $ export LC_COLLATE="C"
user@host ~ $ krusader # this had no issues with names
user@host ~ $ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC=C
LC_TIME=ru_RU.UTF-8
LC_COLLATE=C
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES=C
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
user@host ~ $ export LC_ALL=""
user@host ~ $ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC=C
LC_TIME=ru_RU.UTF-8
LC_COLLATE=C
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES=C
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=
user@host ~ $ krusader # this had issues with names


@Sergey, simply remove LC_ALL="" line from your /etc/env.d/02locale file.
Comment 41 Sergey 2018-02-19 01:38:00 UTC
Nikita Melnichenko, thank you very much! Your advice helped me to solve this issue.
Comment 42 Nikita Melnichenko 2018-02-19 22:40:20 UTC
Sergey, you are welcome.