This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: locale-source validation script


Zack Weinberg <zackw@panix.com> wrote:

> - The complaints about "inappropriate character '\t'" are all caused
> by _unintentional_ tabs inside strings.  If you write
>
> message "xyz/
>          abc"
>
> the whitespace on the second line gets included in the string, which
> is not what you want.

Yes, at the moment we get for example:

$ LC_ALL=et_EE.UTF-8 locale -k postal_fmt
postal_fmt="%a%N		 %f%N		 %d%N		 %b%N		 %s%t%h%t%e%t%r%N	 %C-%z %T%N		 %c%N"

I’ll fix it like this, this is far more readable as well:

diff --git a/localedata/locales/et_EE b/localedata/locales/et_EE
index 93392659f4..7f68dabc18 100644
--- a/localedata/locales/et_EE
+++ b/localedata/locales/et_EE
@@ -2229,13 +2229,7 @@ name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
 END LC_NAME
 
 LC_ADDRESS
-postal_fmt      "<U0025><U0061><U0025><U004E>/
-		 <U0025><U0066><U0025><U004E>/
-		 <U0025><U0064><U0025><U004E>/
-		 <U0025><U0062><U0025><U004E>/
-		 <U0025><U0073><U0025><U0074><U0025><U0068><U0025><U0074><U0025><U0065><U0025><U0074><U0025><U0072><U0025><U004E>/
-		 <U0025><U0043><U002D><U0025><U007A><U0020><U0025><U0054><U0025><U004E>/
-		 <U0025><U0063><U0025><U004E>"
+postal_fmt      "%a%N%f%N%d%N%b%N%s%t%h%t%e%t%r%N%C-%z %T%N%c%N"
 country_name    "<U0045><U0065><U0073><U0074><U0069>"
 country_post    "<U0045><U0045>"
 country_ab2     "<U0045><U0045>"

And it seems to work correctly:

bash-4.4# LC_ALL=et_EE.UTF-8 locale -k postal_fmt
postal_fmt="%a%N%f%N%d%N%b%N%s%t%h%t%e%t%r%N%C-%z %T%N%c%N"

> The linter currently only detects this when
> that indentation is done with tabs, but I think it should probably
> detect spaces as well.  If you _mean_ to put a tab in a string write
> <U0009>. :-)



-- 
Mike FABIAN <mfabian@redhat.com>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]