After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 710487 - Standard folder names are not shown in Russian locale
Standard folder names are not shown in Russian locale
Product: nautilus
Classification: Core
Component: Bookmarks
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Reported: 2013-10-19 01:07 UTC by Urmas
Modified: 2018-09-08 23:29 UTC
See Also:
GNOME target: ---
GNOME version: ---

PICTURE (5.51 KB, image/png)
2013-10-19 01:07 UTC, Urmas
FEDORA (3.07 KB, image/png)
2013-10-22 00:42 UTC, Urmas

Description Urmas 2013-10-19 01:07:31 UTC
Created attachment 257682 [details]

There are some 'invalid glyph' characters instead.

Additionally, their tooltip shows some mumbo-jumbo in %-encoded format.
Comment 1 André Klapper 2013-10-19 12:14:15 UTC
How to reproduce exactly, click by click? 
What is the exact locale (output of the command "locale" in a terminal window)?
Which version of xdg-user-dirs is installed?
Comment 2 Urmas 2013-10-20 04:16:01 UTC
???? Just open home folder, it's right there.


xdg-user-dirs in 0.14
Comment 3 André Klapper 2013-10-20 13:01:23 UTC
Места, Корзина, etc. all shown correctly for me in Fedora and nautilus 3.8.

Which distribution is this about? Did you file a ticket in the bugtracker of your distribution?
Comment 4 Urmas 2013-10-22 00:42:54 UTC
Created attachment 257805 [details]
Comment 5 Urmas 2013-10-22 00:44:49 UTC
I tried with Fedora/3.8.2, same effect.
Comment 6 António Fernandes 2017-09-04 11:48:34 UTC
Is this bug still happening?

Nautilus now uses GtkPlacesSidebar instead of it's own sidebar.
Comment 7 Urmas 2018-09-08 17:29:28 UTC
Yes, it still happens in 3.26.4.
Comment 8 André Klapper 2018-09-08 17:54:46 UTC
What is the output of the following two commands:

more ~/.config/user-dirs.locale
more /etc/xdg/user-dirs.conf
Comment 9 António Fernandes 2018-09-08 18:13:02 UTC
Also, what is the output of this command?

Comment 10 António Fernandes 2018-09-08 19:40:45 UTC
I think I may have reproduced this bug by running the following command:

> LANG=ru_RU G_FILENAME_ENCODING=@locale nautilus

My locale is "pt_PT.UTF-8", and the localization of the "Music" folder in has a non-ascii character ("ú"): "Música".

When running the above command, nautilus Home folder view will display "MУКsica", which is correct given the filename encoding. But the sidebar still displays "Música", which is wrong. However, the tooltip actually displays "/home/antonio/MУКsica".

(My /etc/xdg/user-dirs.conf file has filename_encoding=UTF-8, and I don't have a ~/.config/user-dirs.conf file.)
Comment 11 António Fernandes 2018-09-08 22:00:08 UTC
OK, I was able to reproduce the bug exactly as reported.

### Steps to reproduce:

1) Have a ~/.config/user-dirs.conf text file with the following content:

> filename_encoding=koi8r

2) Quit nautilus with this command:

> nautilus -q

3) Run this command to update user-dirs.dirs to ru_RU.KOI8-R:

> LANG=ru_RU.koi8r xdg-user-dirs-gtk-update

3.1) In the dialog, choose the second action (which confirms updating the folder names)

4) Launch nautilus in Russian:

> LANG=ru_RU.koi8r nautilus

### Results

The terminal output displays repeated messages like this:

> (nautilus:22474): Pango-WARNING **: 22:36:12.412: Invalid UTF-8 string passed to pango_layout_set_text()

The XDG folders in the sidebar are displayed with invalid character, as originally described. The tooltips also show %-encoded IRIs.

Everywhere else in nautilus interface, the XDG folders have their name correctly displayed for this encoding (ex. the music folder is "Музыка").

Different from the screenshot in attachment 257682 [details] is that "Recent", "Home", "Trash" etc. are all properly translated. This may be because I have gone with "LANG=ru_RU.koi8r" instead of "LANG=ru_RU.koi8u". I did it this because of this warning:

> (nautilus:22986): Gtk-WARNING **: 22:46:15.855: Locale not supported by C library.
> 	Using the fallback 'C' locale.

KOI8-U differs from KOI8-R by only 8 characters, so it should not make a difference for the purpose of this bug.
Comment 12 António Fernandes 2018-09-08 22:05:42 UTC
From reading the source code of gtk/gtkplacessidebar.c, I've noticed that, for the built-in xdg-user-dirs location (except Desktop), we get the name from g_file_get_basename().

According to the docs:

> The base name is a byte string (not UTF-8). It has no defined encoding

But then we proceed to use that label in UI anyway (assuming that it is UTF-8). I'm not sure but this may be the problem.

About the tooltip, we get it with g_file_get_parse_name(), which, as documented, may return a IRI, which may explain the "mumbo-jumbo in %-encoded format." as originally reported.

In any case, this bug is not specific to nautilus but is present in any use of GtkPlacesSidebar. So, I will create a new issue in GitLab before closing here.


@Urmas, in any case, please confirm if /etc/xdg/user-dirs.conf or ~/.config/user-dirs.conf in your system contain the line filename_encoding=koi8u
Comment 13 António Fernandes 2018-09-08 23:29:15 UTC
Reported to Gtk+ as

Let's continue tracking this there.