D. The Legacy-Mixed Encoding (Deprecated)

The Legacy-Mixed encoding corresponds to the traditional encoding of desktop files in older versions of the GNOME and KDE desktop files. In this encoding, the encoding of each localestring key is determined by the locale tag for that key, if any, instead of being UTF-8. For keys without a locale tag, the value must contain only ASCII characters.

If the file specifies an unsupported encoding, the implementation should either ignore the file, or, if the user has requested a direct operation on the file (such as opening it for editing), display an appropriate error indication to the user.

In the absence of an Encoding line, the implementation may choose to autodetect the encoding of the file by using such factors as:

If the implementation does not perform such auto-detection, it should treat a file without an Encoding key in the same way as a file with an unsupported Encoding Key.

If the locale tag includes an .ENCODING part, then that determines the encoding for the line. Otherwise, the encoding is determined by the language, or lang_COUNTRY pair from the locale tag, according to the following table.

EncodingAliasesTags
ARMSCII-8 (*) hy
BIG5 zh_TW
CP1251 be bg
EUC-CNGB2312zh_CN
EUC-JP ja
EUC-KR ko
GEORGIAN-ACADEMY (*)  
GEORGIAN-PS (*) ka
ISO-8859-1 br ca da de en es eu fi fr gl it nl no pt sv wa
ISO-8859-2 cs hr hu pl ro sk sl sq sr
ISO-8859-3  eo
ISO-8859-5 mk sp
ISO-8859-7 el
ISO-8859-9 tr
ISO-8859-13 lt lv mi
ISO-8859-14 cy ga
ISO-8859-15 et
KOI8-R ru
KOI8-U uk
TCVN-5712 (*)TCVNvi
TIS-620 th
VISCII  
Encoding

The name given here is listed here is typically the canonical name for the encoding in the GNU C Library's iconv facility. Encodings marked with (*) are not currently supported by the GNU C Library; for this reason, implementations may choose to ignore lines in desktop files that resolve to this encoding. Desktop files with these encodings are currently rare or non-existent.

Aliases

Other names for the encoding found in existing desktop files.

Tags

Language tags for which this is the default encoding.

This table above covers all tags and encodings that are known to be currently in use. Implementors may choose to support encodings not in the above set. For tags without defaults listed in the above table, desktop file creators must specify the .ENCODING part of the locale tag.

Matching the .ENCODING part of the locale tag against a locale name or alias should be done by stripping all punctuation characters from both the tag and the name or alias, converting both name and alias to lowercase, and comparing the result. This is necessary because, for example, Big5 is frequently found instead of BIG5 and georgianacademy instead of GEORGIAN-ACADEMY. Desktop files creators should, however, use the name as it appears in the "Encoding" column above.