/[gentoo]/xml/htdocs/proj/en/glep/glep-0031.txt
Gentoo

Contents of /xml/htdocs/proj/en/glep/glep-0031.txt

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Oct 28 17:00:22 2004 UTC (9 years, 11 months ago) by g2boojum
Branch: MAIN
File MIME type: text/plain
new glep

1 g2boojum 1.1 GLEP: 31
2     Title: Character Sets for Portage Tree Items
3     Version: $Revision: $
4     Author: Ciaran McCreesh <ciaranm@gentoo.org>
5     Last-Modified: $Date: $
6     Status: Draft
7     Type: Standards Track
8     Content-Type: text/x-rst
9     Created: 27-October-2004
10     Post-Date: 28-October-2004
11    
12     Abstract
13     ========
14    
15     A set of rules regarding what characters are permissible in the portage
16     tree and how they should be encoded is required.
17    
18     Motivation
19     ==========
20    
21     At present we have several developers and many more users whose names
22     require characters (for example, accents) which are not part of the
23     standard 'safe' 0..127 ASCII range. There is no current standard on how
24     these should be represented, leading to inconsistency across the tree.
25    
26     Although the issues involved have been discussed many times informally, no
27     official decision has been made.
28    
29     Specification
30     =============
31    
32     ChangeLog and Metadata Character Sets
33     -------------------------------------
34    
35     It is proposed that UTF-8 ([1]_) is used for encoding ChangeLog and
36     metadata.xml files inside the portage tree.
37    
38     UTF-8 allows the full range of Unicode ([2]_) characters to be expressed,
39     which is necessary given the diversity of the Gentoo developer- and
40     user-base. It is character-compatible with ASCII for the 0..127
41     characters and does not significantly increase the storage requirements
42     for files which consist mainly of American English characters. It is
43     widely supported, widely used and an official standard.
44    
45     The ISO-8859-* character sets ([3]_) would *not* be appropriate since they
46     cannot express the full range of required characters.
47    
48     Ebuild and Eclass Character Sets
49     --------------------------------
50    
51     For the same reasons as previously, it is proposed that UTF-8 is used as
52     the official encoding for ebuild and eclass files.
53    
54     However, developers should be warned that any output which is parsed by
55     bash (in other words, non-comments), and any output which is echoed to the
56     screen (for example, einfo messages) must not use anything outside the
57     regular ASCII 0..127 range for compatibility purposes.
58    
59     files/ Entries Character Sets
60     -----------------------------
61    
62     Patches must clearly be in the same character set as the file they are
63     patching. For other files/ entries (for example, GNOME desktop files),
64     consistency with the upstream-recommended character set is most sensible.
65    
66     Suitable Characters for File and Directory Names
67     ------------------------------------------------
68    
69     Characters outside the ASCII 0..127 range cannot safely be used for file
70     or directory names. (Of course, not all characters inside the ASCII 0..127
71     range can be used safely either.)
72    
73     Backwards Compatibility
74     =======================
75    
76     The existing tree uses a mixture of encodings. It would be straightforward
77     to fix existing ChangeLogs and metadata files to use UTF-8.
78    
79     The ``echangelog`` tool is character-set agnostic. In order to properly
80     enter UTF-8, developers would have to switch to a UTF-8 shell session.
81     This only applies if the developer is entering new text which uses 'fancy'
82     characters -- existing characters are not mangled.
83    
84     Certain text editors are incapable of handling UTF-8 cleanly. However,
85     since the ``echangelog`` tool is generally the correct way to generate
86     ChangeLog entries, this should not be a major problem. Generating
87     metadata.xml files correctly in these editors could become problematic.
88     (The ``vim`` and ``emacs`` editors, which appear to be most widely used,
89     are both capable of handling UTF-8 cleanly.)
90    
91     References
92     ==========
93    
94     .. [1] RFC 3629: UTF-8, a transformation format of ISO 10646
95     http://www.ietf.org/rfc/rfc3629.txt
96     .. [2] ISO/IEC 10646 (Universal Multiple-Octet Coded Character Set)
97     .. [3] ISO/IEC 8859 (8-bit single-byte coded graphic character sets)
98    
99     Copyright
100     =========
101    
102     This document has been placed in the public domain.
103    
104     vim: set tw=74 fileencoding=utf-8 :

  ViewVC Help
Powered by ViewVC 1.1.20