locales LC_NUMERIC: Overhaul completely wrong definitions
authorJohn Marino <draco@marino.st>
Wed, 22 Jul 2015 17:08:43 +0000 (19:08 +0200)
committerJohn Marino <draco@marino.st>
Wed, 22 Jul 2015 17:14:14 +0000 (19:14 +0200)
I have no idea how the UTF-8 definitions were created.  They appear
to be grouped by (allegedly) similar countries with the same
definitions as other codesets.  The assumption is wrong.  I went through
every POSIX (UTF-8) definition on http://unicode.org and redefined all
UTF-8 locales. Besides being correct, there are 2 additional benefits:
1) The makefile is loads simpler, at least for UTF-8 part
2) This fixes a lot of locale failures on gcc testsuite

share/numericdef/Makefile
share/numericdef/af_ZA.UTF-8.src [copied from share/numericdef/mn_MN.UTF-8.src with 57% similarity]
share/numericdef/de_CH.UTF-8.src [copied from share/numericdef/mn_MN.UTF-8.src with 63% similarity]
share/numericdef/de_DE.UTF-8.src [copied from share/numericdef/mn_MN.UTF-8.src with 63% similarity]
share/numericdef/en_US.UTF-8.src [moved from share/numericdef/am_ET.UTF-8.src with 63% similarity]
share/numericdef/hy_AM.UTF-8.src [moved from share/numericdef/mn_MN.UTF-8.src with 63% similarity]

index 8087a58..8e36b53 100644 (file)
@@ -1,16 +1,19 @@
 # $FreeBSD: head/share/numericdef/Makefile 245889 2013-01-24 17:00:11Z brooks $
 
 LOCALES=       af_ZA.ISO8859-1 \
-               am_ET.UTF-8 \
+               af_ZA.UTF-8 \
                be_BY.CP1251 \
                bg_BG.CP1251 \
                ca_ES.ISO8859-1 \
                cs_CZ.ISO8859-2 \
                da_DK.ISO8859-1 \
                de_CH.ISO8859-1 \
+               de_CH.UTF-8 \
                de_DE.ISO8859-1 \
+               de_DE.UTF-8 \
                el_GR.ISO8859-7 \
                en_US.ISO8859-1 \
+               en_US.UTF-8 \
                es_ES.ISO8859-1 \
                et_EE.ISO8859-15 \
                eu_ES.ISO8859-1 \
@@ -21,13 +24,13 @@ LOCALES=    af_ZA.ISO8859-1 \
                hr_HR.ISO8859-2 \
                hu_HU.ISO8859-2 \
                hy_AM.ARMSCII-8 \
+               hy_AM.UTF-8 \
                is_IS.ISO8859-1 \
                it_IT.ISO8859-1 \
                ja_JP.eucJP \
                kk_KZ.PT154 \
                ko_KR.eucKR \
                lt_LT.ISO8859-13 \
-               mn_MN.UTF-8 \
                nl_NL.ISO8859-1 \
                no_NO.ISO8859-1 \
                pl_PL.ISO8859-2 \
@@ -67,6 +70,7 @@ ENCODINGS=    ARMSCII-8 Big5 Big5HKSCS \
                ISO8859-13 ISO8859-15 \
                KOI8-R KOI8-U PT154 SJIS US-ASCII UTF-8
 
+# Only for ISO and other codesets (explicitly: not UTF-8)
 BE_LINKS=      fr_BE:nl_BE
 CA_LINKS=      ca_ES:ca_AD ca_ES:ca_FR ca_ES:ca_IT
 DE_LINKS=      de_DE:de_AT
@@ -76,22 +80,38 @@ IT_LINKS=   it_IT:it_CH
 NO_LINKS=      no_NO:nb_NO no_NO:nn_NO
 US_LINKS=      en_US:en_CA en_US:en_GB
 
-ARMSCII-8_UTF-8= hy_AM
-Big5_UTF-8=    zh_TW:zh_HK zh_TW
+# Identical UTF-8 styles
+# DOT_COMMA_3  copies en_US
+# DOT_TICK_3   copies de_CH
+# COMMA_DOT    copies hy_AM
+# COMMA_DOT_3  copies de_DE
+# COMMA_NBSP_3 copies af_ZA
+
+DOT_COMMA_3=   en_US:am_ET en_US:en_AU en_US:en_CA en_US:en_GB \
+               en_US:en_IE en_US:en_NZ en_US:he_IL en_US:ja_JP \
+               en_US:ko_KR en_US:mn_MN en_US:sr_YU en_US:zh_CN \
+               en_US:zh_HK en_US:zh_TW
+DOT_TICK_3=    de_CH:fr_CH de_CH:it_CH
+COMMA_DOT_3=   de_DE:ca_AD de_DE:ca_ES de_DE:ca_FR de_DE:ca_IT \
+               de_DE:da_DK de_DE:de_AT de_DE:el_GR de_DE:es_ES \
+               de_DE:eu_ES de_DE:fr_BE de_DE:hr_HR de_DE:is_IS \
+               de_DE:it_IT de_DE:lt_LT de_DE:nl_BE de_DE:nl_NL \
+               de_DE:pt_BR de_DE:ro_RO de_DE:sl_SI de_DE:tr_TR
+COMMA_NBSP_3=  af_ZA:be_BY af_ZA:bg_BG af_ZA:cs_CZ af_ZA:et_EE \
+               af_ZA:fi_FI af_ZA:fr_CA af_ZA:fr_FR af_ZA:hu_HU \
+               af_ZA:kk_KZ af_ZA:lv_LV af_ZA:nb_NO af_ZA:nn_NO \
+               af_ZA:no_NO af_ZA:pl_PL af_ZA:pt_PT af_ZA:ru_RU \
+               af_ZA:sk_SK af_ZA:sv_SE af_ZA:uk_UA
+
 CP1251_CP1131= be_BY
 CP1251_ISO8859-5= be_BY
-CP1251_UTF-8=  be_BY bg_BG
-CP866_UTF-8=   ru_RU
 eucCN_Big5=    zh_CN:zh_TW
 eucCN_Big5HKSCS= zh_CN:zh_HK
 eucCN_GB18030= zh_CN
 eucCN_GB2312=  zh_CN
 eucCN_GBK=     zh_CN
-eucCN_UTF-8=   zh_CN
 eucJP_SJIS=    ja_JP
-eucJP_UTF-8=   ja_JP
 eucKR_CP949=   ko_KR
-eucKR_UTF-8=   ko_KR
 ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES \
                fi_FI fr_BE fr_FR is_IS it_IT nl_NL no_NO pt_PT sv_SE \
                ${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
@@ -99,25 +119,14 @@ ISO8859-1_ISO8859-15= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES \
 ISO8859-1_ISO8859-1= ${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} \
                ${GB_LINKS} ${IT_LINKS} ${NO_LINKS} ${US_LINKS}
 ISO8859-1_US-ASCII= en_US ${GB_LINKS} ${US_LINKS}
-ISO8859-1_UTF-8= af_ZA ca_ES da_DK de_CH de_DE en_US es_ES eu_ES fi_FI \
-               fr_BE fr_FR is_IS it_IT nl_NL no_NO pt_BR pt_PT sv_SE
-ISO8859-2_UTF-8= cs_CZ hr_HR hu_HU pl_PL ro_RO sk_SK sl_SI
-ISO8859-5_UTF-8= sr_YU uk_UA
 ISO8859-5_CP1251= uk_UA
-ISO8859-7_UTF-8= el_GR
-ISO8859-9_UTF-8= tr_TR
 ISO8859-13_ISO8859-4= lt_LT
 ISO8859-13_ISO8859-13= lt_LT:lv_LV
-ISO8859-13_UTF-8= lt_LT lt_LT:lv_LV
-ISO8859-15_UTF-8= et_EE
 KOI8-R_CP1251= ru_RU
 KOI8-R_CP866=  ru_RU
 KOI8-R_ISO8859-5= ru_RU
 KOI8-U_ISO8859-5= uk_UA
-PT154_UTF-8=   kk_KZ
-US-ASCII_UTF-8=        en_US:he_IL
-UTF-8_UTF-8=   ${BE_LINKS} ${CA_LINKS} ${DE_LINKS} ${FR_LINKS} ${GB_LINKS} \
-               en_GB:en_IE ${IT_LINKS} ${NO_LINKS} ${US_LINKS}
+UTF-8_UTF-8=   ${DOT_COMMA_3} ${COMMA_NBSP_3} ${COMMA_DOT_3} ${DOT_TICK_3}
 
 SYMLINKS=
 .for enc1 in ${ENCODINGS}
similarity index 57%
copy from share/numericdef/mn_MN.UTF-8.src
copy to share/numericdef/af_ZA.UTF-8.src
index 6415d44..8cf08d7 100644 (file)
@@ -1,12 +1,10 @@
-# $FreeBSD: src/share/numericdef/mn_MN.UTF-8.src,v 1.2 2012/11/17 01:51:00 svnexp Exp $
-#
 # WARNING: spaces may be essential at the end of lines
 # WARNING: empty lines are essential too
 #
 # decimal_point
-.
-# thousands_sep
 ,
+# thousands_sep (non-breaking space)
+ΓΏ
 # grouping, separated by ;
-3;3
+3
 # EOF
similarity index 63%
copy from share/numericdef/mn_MN.UTF-8.src
copy to share/numericdef/de_CH.UTF-8.src
index 6415d44..388a8a4 100644 (file)
@@ -1,12 +1,10 @@
-# $FreeBSD: src/share/numericdef/mn_MN.UTF-8.src,v 1.2 2012/11/17 01:51:00 svnexp Exp $
-#
 # WARNING: spaces may be essential at the end of lines
 # WARNING: empty lines are essential too
 #
 # decimal_point
-.
-# thousands_sep
 ,
+# thousands_sep
+'
 # grouping, separated by ;
-3;3
+3
 # EOF
similarity index 63%
copy from share/numericdef/mn_MN.UTF-8.src
copy to share/numericdef/de_DE.UTF-8.src
index 6415d44..7b8ac57 100644 (file)
@@ -1,12 +1,10 @@
-# $FreeBSD: src/share/numericdef/mn_MN.UTF-8.src,v 1.2 2012/11/17 01:51:00 svnexp Exp $
-#
 # WARNING: spaces may be essential at the end of lines
 # WARNING: empty lines are essential too
 #
 # decimal_point
-.
-# thousands_sep
 ,
+# thousands_sep
+.
 # grouping, separated by ;
-3;3
+3
 # EOF
similarity index 63%
rename from share/numericdef/am_ET.UTF-8.src
rename to share/numericdef/en_US.UTF-8.src
index a34dd9e..f64961d 100644 (file)
@@ -1,5 +1,3 @@
-# $FreeBSD: src/share/numericdef/am_ET.UTF-8.src,v 1.2 2012/11/17 01:51:00 svnexp Exp $
-#
 # WARNING: spaces may be essential at the end of lines
 # WARNING: empty lines are essential too
 #
@@ -8,5 +6,5 @@
 # thousands_sep
 ,
 # grouping, separated by ;
-3;3
+3
 # EOF
similarity index 63%
rename from share/numericdef/mn_MN.UTF-8.src
rename to share/numericdef/hy_AM.UTF-8.src
index 6415d44..7bf9f03 100644 (file)
@@ -1,12 +1,10 @@
-# $FreeBSD: src/share/numericdef/mn_MN.UTF-8.src,v 1.2 2012/11/17 01:51:00 svnexp Exp $
-#
 # WARNING: spaces may be essential at the end of lines
 # WARNING: empty lines are essential too
 #
 # decimal_point
-.
-# thousands_sep
 ,
+# thousands_sep
+.
 # grouping, separated by ;
-3;3
+-1
 # EOF