Menu spec: .desktop filename encoding issue

Mark McLoughlin markmc at redhat.com
Wed Jul 20 19:03:09 EEST 2005


Hi,
	This gnome-menus bug:

  http://bugzilla.gnome.org/show_bug.cgi?id=310939

	brought up an interesting problem.

	If a .desktop filename is encoded using some unknown charset[1] then
the filename is essentially junk (i.e. you can't reliably convert it to
a known encoding).

	This could cause problems if you later try to use filename as a
desktop-file-id in a .menu file since the filename would not be valid in
the encoding of the .menu file.

	I guess an implementation has two choices:

  1) When writing .menu files, escape the desktop-file-id such that it
     is valid in the encoding of the file and unescape it when parsing.

  2) Just completely ignore .desktop files whose filenames use some 
     bogus encoding.

	We should recommend a course of action in the specification. The
problem with doing (1) is that it changes the semantics of the
<Filename> tag. I've made gnome-menus do (2) for now - since its such a
corner case, it seems like a reasonable course to take?

Cheers,
Mark.

[1] -  e.g. the filename is encoded in ISO-8859-15 and the locale's
charset is UTF-8




More information about the xdg mailing list