/[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.2 - (show annotations) (download)
Mon Nov 1 20:24:06 2004 UTC (10 years, 1 month ago) by g2boojum
Branch: MAIN
Changes since 1.1: +13 -9 lines
File MIME type: text/plain
update

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, 1-November-2004
11
12 Abstract
13 ========
14
15 A set of guidelines regarding what characters are permissible in the
16 portage 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 informally many times, 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 code which is parsed by bash
55 (in other words, non-comments), and any output which is echoed to the
56 screen (for example, einfo messages) or given to portage (for example any
57 of the standard global variables) must not use anything outside the
58 regular ASCII 0..127 range for compatibility purposes.
59
60 files/ Entries Character Sets
61 -----------------------------
62
63 Patches must clearly be in the same character set as the file they are
64 patching. For other files/ entries (for example, GNOME desktop files),
65 consistency with the upstream-recommended character set is most sensible.
66
67 Suitable Characters for File and Directory Names
68 ------------------------------------------------
69
70 Characters outside the ASCII 0..127 range cannot safely be used for file
71 or directory names. (Of course, not all characters inside the ASCII 0..127
72 range can be used safely either.)
73
74 Backwards Compatibility
75 =======================
76
77 The existing tree uses a mixture of encodings. It would be straightforward
78 to fix existing ChangeLogs and metadata files to use UTF-8.
79
80 The ``echangelog`` tool is character-set agnostic. In order to properly
81 enter UTF-8, developers would have to switch to a UTF-8 shell session.
82 This only applies if the developer is entering new text which uses 'fancy'
83 characters -- existing characters are not mangled.
84
85 Certain text editors are incapable of handling UTF-8 cleanly. However,
86 since the ``echangelog`` tool is generally the correct way to generate
87 ChangeLog entries, this should not be a major problem. Generating
88 metadata.xml files correctly in these editors could become problematic.
89 The ``vim`` and ``emacs`` editors, which appear to be most widely used,
90 are both capable of handling UTF-8 cleanly -- for vim, this could be
91 configured automatically via the ``gentoo-syntax`` ([4]_) package.
92
93 References
94 ==========
95
96 .. [1] RFC 3629: UTF-8, a transformation format of ISO 10646
97 http://www.ietf.org/rfc/rfc3629.txt
98 .. [2] ISO/IEC 10646 (Universal Multiple-Octet Coded Character Set)
99 .. [3] ISO/IEC 8859 (8-bit single-byte coded graphic character sets)
100 .. [4] The app-vim/gentoo-syntax package,
101 https://developer.berlios.de/projects/gentoo-syntax/
102
103 Copyright
104 =========
105
106 This document has been placed in the public domain.
107
108 vim: set tw=74 fileencoding=utf-8 :

  ViewVC Help
Powered by ViewVC 1.1.20