[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] standards: rewrite section on quoting

From: Paolo Bonzini
Subject: [PATCH] standards: rewrite section on quoting
Date: Tue, 20 Dec 2011 09:59:42 +0100

GCC has been using apostrophes for quotes in the C locale for seven
years, and gnulib is following suit.  Describe this in the GNU coding
standards and add instructions about translating quotes and providing
parseable output.

* doc/standards.texi (Quote Characters): Add note about translating
quote characters and providing parseable output.  Do not anymore suggest
the grave accent as the opening quote character.  Suggest adding an
option such as GNU ls's --quoting-style.
 doc/standards.texi |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/doc/standards.texi b/doc/standards.texi
index 99d76f0..7d88d04 100644
--- a/doc/standards.texi
+++ b/doc/standards.texi
@@ -3274,12 +3274,29 @@ Quote Characters
 @cindex quote characters
 @cindex locale-specific quote characters
 @cindex left quote
address@hidden opening quote
address@hidden single quotes
 @cindex grave accent
 In the C locale, GNU programs should stick to plain ASCII for quotation
-characters in messages to users: preferably 0x60 (@samp{`}) for left
-quotes and 0x27 (@samp{'}) for right quotes.  It is ok, but not
-required, to use locale-specific quotes in other locales.
+characters in messages to users: preferably 0x27 (@samp{'}) for both
+opening and closing quotes.
+It is ok, but not required, to use locale-specific quotes in other
+locales.  English messages should use single quotes; use Unicode U+2018
+for the opening quote and U+2019 for the closing quote.  Remember however
+that you should never use Unicode in the C locale.
+If you support internationalization, translators should be able to provide
+their own quote characters.  By convention, the string @samp{"`"} will
+translate to the opening quote and the string @samp{"'"} will translate
+to the closing quote.
+If the output of your program is ever likely to be parsed by another
+program, provide an option that makes this parsing reliable.  For example
+you could escape special characters using conventions from the C language
+or the Bourne shell.  See for example the option @option{--quoting-style}
+of GNU @code{ls}.
 The @uref{, Gnulib} @code{quote} and
 @code{quotearg} modules provide a reasonably straightforward way to
@@ -3287,23 +3304,6 @@ Quote Characters
 other issues, such as quoting a filename that itself contains a quote
 character.  See the Gnulib documentation for usage details.
-In any case, the documentation for your program should clearly specify
-how it does quoting, if different than the preferred method of @samp{`}
-and @samp{'}.  This is especially important if the output of your
-program is ever likely to be parsed by another program.
-Quotation characters are a difficult area in the computing world at
-this time: there are no true left or right quote characters in Latin1;
-the @samp{`} character we use was standardized there as a grave
-accent.  Moreover, Latin1 is still not universally usable.
-Unicode contains the unambiguous quote characters required, and its
-common encoding UTF-8 is upward compatible with Latin1.  However,
-Unicode and UTF-8 are not universally well-supported, either.
-This may change over the next few years, and then we will revisit
 @node Mmap
 @section Mmap

reply via email to

[Prev in Thread] Current Thread [Next in Thread]