Re: svn commit: r340144 - in head: lib/libc/locale share/ctypedef tools/tools/locale tools/tools/locale/tools

2018-11-05 Thread Baptiste Daroussin
On Mon, Nov 05, 2018 at 11:47:44AM +0300, Yuri Pankov wrote:
> Baptiste Daroussin wrote:
> > On Sun, Nov 04, 2018 at 10:13:22PM +, Yuri Pankov wrote:
> >> Author: yuripv
> >> Date: Sun Nov  4 22:13:22 2018
> >> New Revision: 340144
> >> URL: https://svnweb.freebsd.org/changeset/base/340144
> >>
> >> Log:
> >>   Add hybrid C.UTF-8 locale being identical to default C locale except
> >>   that it uses the same ctype maps and functions as other UTF-8 locales.
> >>   
> >>   Reviewed by: bapt, cem, eadler
> >>   Approved by: kib (mentor, implicit)
> >>   Differential Revision:   https://reviews.freebsd.org/D17833
> >>
> > Excellent, do you plan to MFC that so freebsd 12.1 and freebsd 11.3 can 
> > benefit
> > it?
> 
> Yes, will do along with CLDR 34 data (MFC period specified as 1 month
> there).
> 

Wonderful thanks!

Bapt


signature.asc
Description: PGP signature


Re: svn commit: r340144 - in head: lib/libc/locale share/ctypedef tools/tools/locale tools/tools/locale/tools

2018-11-05 Thread Yuri Pankov
Baptiste Daroussin wrote:
> On Sun, Nov 04, 2018 at 10:13:22PM +, Yuri Pankov wrote:
>> Author: yuripv
>> Date: Sun Nov  4 22:13:22 2018
>> New Revision: 340144
>> URL: https://svnweb.freebsd.org/changeset/base/340144
>>
>> Log:
>>   Add hybrid C.UTF-8 locale being identical to default C locale except
>>   that it uses the same ctype maps and functions as other UTF-8 locales.
>>   
>>   Reviewed by:   bapt, cem, eadler
>>   Approved by:   kib (mentor, implicit)
>>   Differential Revision: https://reviews.freebsd.org/D17833
>>
> Excellent, do you plan to MFC that so freebsd 12.1 and freebsd 11.3 can 
> benefit
> it?

Yes, will do along with CLDR 34 data (MFC period specified as 1 month
there).



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r340144 - in head: lib/libc/locale share/ctypedef tools/tools/locale tools/tools/locale/tools

2018-11-05 Thread Baptiste Daroussin
On Sun, Nov 04, 2018 at 10:13:22PM +, Yuri Pankov wrote:
> Author: yuripv
> Date: Sun Nov  4 22:13:22 2018
> New Revision: 340144
> URL: https://svnweb.freebsd.org/changeset/base/340144
> 
> Log:
>   Add hybrid C.UTF-8 locale being identical to default C locale except
>   that it uses the same ctype maps and functions as other UTF-8 locales.
>   
>   Reviewed by:bapt, cem, eadler
>   Approved by:kib (mentor, implicit)
>   Differential Revision:  https://reviews.freebsd.org/D17833
> 
Excellent, do you plan to MFC that so freebsd 12.1 and freebsd 11.3 can benefit
it?

Best regards,
Bapt


signature.asc
Description: PGP signature


svn commit: r340144 - in head: lib/libc/locale share/ctypedef tools/tools/locale tools/tools/locale/tools

2018-11-04 Thread Yuri Pankov
Author: yuripv
Date: Sun Nov  4 22:13:22 2018
New Revision: 340144
URL: https://svnweb.freebsd.org/changeset/base/340144

Log:
  Add hybrid C.UTF-8 locale being identical to default C locale except
  that it uses the same ctype maps and functions as other UTF-8 locales.
  
  Reviewed by:  bapt, cem, eadler
  Approved by:  kib (mentor, implicit)
  Differential Revision:https://reviews.freebsd.org/D17833

Added:
  head/share/ctypedef/C.UTF-8.src
 - copied unchanged from r340143, head/share/ctypedef/en_US.UTF-8.src
Deleted:
  head/share/ctypedef/en_US.UTF-8.src
Modified:
  head/lib/libc/locale/collate.c
  head/lib/libc/locale/ldpart.c
  head/share/ctypedef/Makefile
  head/tools/tools/locale/Makefile
  head/tools/tools/locale/tools/cldr2def.pl

Modified: head/lib/libc/locale/collate.c
==
--- head/lib/libc/locale/collate.c  Sun Nov  4 20:26:29 2018
(r340143)
+++ head/lib/libc/locale/collate.c  Sun Nov  4 22:13:22 2018
(r340144)
@@ -84,7 +84,8 @@ destruct_collate(void *t)
 void *
 __collate_load(const char *encoding, __unused locale_t unused)
 {
-   if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) {
+   if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0 ||
+   strncmp(encoding, "C.", 2) == 0) {
return &__xlocale_C_collate;
}
struct xlocale_collate *table = calloc(sizeof(struct xlocale_collate), 
1);
@@ -122,7 +123,8 @@ __collate_load_tables_l(const char *encoding, struct x
table->__collate_load_error = 1;
 
/* 'encoding' must be already checked. */
-   if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0) {
+   if (strcmp(encoding, "C") == 0 || strcmp(encoding, "POSIX") == 0 ||
+   strncmp(encoding, "C.", 2) == 0) {
return (_LDP_CACHE);
}
 

Modified: head/lib/libc/locale/ldpart.c
==
--- head/lib/libc/locale/ldpart.c   Sun Nov  4 20:26:29 2018
(r340143)
+++ head/lib/libc/locale/ldpart.c   Sun Nov  4 22:13:22 2018
(r340144)
@@ -63,7 +63,8 @@ __part_load_locale(const char *name,
size_t  namesize, bufsize;
 
/* 'name' must be already checked. */
-   if (strcmp(name, "C") == 0 || strcmp(name, "POSIX") == 0) {
+   if (strcmp(name, "C") == 0 || strcmp(name, "POSIX") == 0 ||
+   strncmp(name, "C.", 2) == 0) {
*using_locale = 0;
return (_LDP_CACHE);
}

Copied: head/share/ctypedef/C.UTF-8.src (from r340143, 
head/share/ctypedef/en_US.UTF-8.src)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/ctypedef/C.UTF-8.src Sun Nov  4 22:13:22 2018
(r340144, copy of r340143, head/share/ctypedef/en_US.UTF-8.src)
@@ -0,0 +1,6372 @@
+# Warning: Do not edit. This file is automatically generated from the
+# tools in /usr/src/tools/tools/locale. The data is obtained from the
+# CLDR project, obtained from http://cldr.unicode.org/
+# -
+
+comment_char *
+escape_char /
+
+LC_CTYPE
+
+**
+* 0x - 0x007F Basic Latin
+* 0x0080 - 0x00FF Latin-1 Supplement
+* 0x0100 - 0x017F Latin Extended-A
+* 0x0180 - 0x024F Latin Extended-B
+* 0x0250 - 0x02AF IPA Extensions
+* 0x1D00 - 0x1D7F Phonetic Extensions
+* 0x1D80 - 0x1DBF Phonetic Extensions Supplement
+* 0x1E00 - 0x1EFF Latin Extended Additional
+* 0x2150 - 0x218F Number Forms (partial - Roman Numerals)
+* 0x2C60 - 0x2C7F Latin Extended-C
+* 0xA720 - 0xA7FF Latin Extended-D
+* 0xAB30 - 0xAB6F Latin Extended-E
+* 0xFB00 - 0xFF4F Alphabetic Presentation Forms (partial)
+* 0xFF00 - 0xFFEF Halfwidth and Fullwidth Forms (partial)
+**
+upper  ;...;;/
+   
;...;;/
+   ;...;;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   ;/
+   
;...;;/
+   
;...;;/
+   ;/
+   ;/
+   ;...;;/
+   ;/
+   ;/
+   ;/
+   ;/
+