A bug on Chinese characters when ReName a .desktop or change icon of a .desktop

肇 鑫 hutigers at hotmail.com
Wed Sep 3 09:10:30 UTC 2003


Today I encounter a problem when I rename the .desktop in Gnome 2.3.7 in 
Severn.
When I try to name in English, it will be OK. However, if I change the icon 
of the .desktop or rename it by right-click on it and use Chinese 
characters(GB2312), some problems comes.
For example:
I have a .desktop which name is 星际译王.desktop(it is the Chinese name of 
stardict which is a e-dictionary) and it appears as 星际译王 on the desktop 
of Gnome. You may see the Chinese character when you change to gb2312.

0. the original context of 星际译王.desktop is
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec=stardict
TryExec=
X-GNOME-DocPath=
Terminal=false
Name[zh_CN]=星际译王
GenericName[zh_CN]=
Comment[zh_CN]=
(I use gedit to open the 星际译王.desktop to see what in it)

1.Then I change the icon of 星际译王.desktop. The problem comes, after I 
change the icon of the .desktop. Its name appears on the desktop of Gnome 
changes to "No Name". 
And the context of the 星际译王.desktop changes to 
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=No name
Type=Application
Exec=stardict
TryExec=
X-GNOME-DocPath=
Terminal=false
Name[zh_CN]=星际译王
GenericName[zh_CN]=
Comment[zh_CN]=

3 I notice that there are two differences between the two contexts.
The first is the positional reversal between Encoding=UTF-8 and 
Version=1.0.
And the second, which I think is what cause the problem, is that the entry 
"Name=No name" is added.

4 I try to solve the problem myself. And I discover two methods (but not 
the best method). The first is better, I think, is just to open the 
.desktop with text editor and delete the entry "Name=No name" directly and 
then save.
  The second methed is Change the "Name=No name" to "Name=<the name you 
want>" directly. However, if you use the second method and use the Chinese 
charater as the name, unfortunately, although the name of .desktop on the 
desktop looks good or normal, when you re-open the .desktop with gedit or 
vi, you will find the entry "Name=<the name you want>" change to 
"Name=<confuse code which could not distinguish as the name you typed 
before>". So I guess that is why there is an entry "Name[zh_CN]=" in it .

5. That is all about the bug. And I think the reason is that the entry 
"Name=" more superior then the entry "Name[zh_CN]=" cause its position is 
more forward.

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger:  http://messenger.msn.com/cn  





More information about the fedora-test-list mailing list