bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH 3/3] quotearg: do not use grave accent for left quote


From: bonzini
Subject: [PATCH 3/3] quotearg: do not use grave accent for left quote
Date: Tue, 20 Dec 2011 09:57:57 +0100

From: Paolo Bonzini <address@hidden>

* lib/quotearg.c (gettext_quote): Map "`" to "'" for locale_quoting_style.
(quotearg_buffer_restyled): Fix example.
* tests/test-quotearg-simple.c (results_g): Adjust test vectors.
---
 NEWS                         |    9 +++++++++
 lib/quotearg.c               |    7 ++-----
 tests/test-quotearg-simple.c |   12 ++++++------
 3 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/NEWS b/NEWS
index 0322bd2..c9bbcee 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,15 @@
 Important notes
 ---------------
 
+Date        Modules         Changes
+
+2011-12-20  quotearg        In the C locale, the function will no longer use
+                            the grave accent character to begin a quoted
+                            string (`like this').  It will use apostrophes
+                            'like these' or, in Unicode locales, single quotes
+                            ‘like these’.  You may want to adjust any error
+                            messages that hard code the quoting characters.
+
 2010-09-04  gnulib-tool     The option '--import' is no longer cumulative; it
                             now expects the complete list of modules and other
                             options on the command line. If you want to
diff --git a/lib/quotearg.c b/lib/quotearg.c
index 6d80d22..7207d4e 100644
--- a/lib/quotearg.c
+++ b/lib/quotearg.c
@@ -221,10 +221,7 @@ gettext_quote (char const *msgid, enum quoting_style s)
   if (STRCASEEQ (locale_code, "GB18030", 'G','B','1','8','0','3','0',0,0))
     return msgid[0] == '`' ? "\xa1\ae": "\xa1\xaf";
 
-  if (s == clocale_quoting_style)
-    return "\"";
-
-  return translation;
+  return (s == clocale_quoting_style ? "\"" : "'");
 }
 
 /* Place into buffer BUFFER (of size BUFFERSIZE) a quoted version of
@@ -303,7 +300,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
                use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
                Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
                current locale is not Unicode, locale_quoting_style
-               will quote `like this', and clocale_quoting_style will
+               will quote 'like this', and clocale_quoting_style will
                quote "like this".  You should always include translations
                for "`" and "'" even if U+2018 and U+2019 are appropriate
                for your locale.
diff --git a/tests/test-quotearg-simple.c b/tests/test-quotearg-simple.c
index 4d9c87c..fcfce1d 100644
--- a/tests/test-quotearg-simple.c
+++ b/tests/test-quotearg-simple.c
@@ -85,12 +85,12 @@ static struct result_groups results_g[] = {
       "a\\\\b", LQ_ENC RQ_ENC, LQ RQ } },
 
   /* locale_quoting_style */
-  { { "`'", "`\\0001\\0'", 9, "`simple'", "` \\t\\n\\'\"\\033?""?/\\\\'",
-      "`a:b'", "`a\\\\b'", "`" LQ_ENC RQ_ENC "'", "`" LQ RQ "'" },
-    { "`'", "`\\0001\\0'", 9, "`simple'", "` \\t\\n\\'\"\\033?""?/\\\\'",
-      "`a:b'", "`a\\\\b'", "`" LQ_ENC RQ_ENC "'", "`" LQ RQ "'" },
-    { "`'", "`\\0001\\0'", 9, "`simple'", "` \\t\\n\\'\"\\033?""?/\\\\'",
-      "`a\\:b'", "`a\\\\b'", "`" LQ_ENC RQ_ENC "'", "`" LQ RQ "'" } },
+  { { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'",
+      "'a:b'", "'a\\\\b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+    { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'",
+      "'a:b'", "'a\\\\b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" },
+    { "''", "'\\0001\\0'", 9, "'simple'", "' \\t\\n\\'\"\\033?""?/\\\\'",
+      "'a\\:b'", "'a\\\\b'", "'" LQ_ENC RQ_ENC "'", "'" LQ RQ "'" } },
 
   /* clocale_quoting_style */
   { { "\"\"", "\"\\0001\\0\"", 9, "\"simple\"",
-- 
1.7.7.1




reply via email to

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