4006 Certain printable unicode characters misclassified as nonprintable
[unleashed.git] / usr / src / cmd / localedef / data / ctype.sh
blob771585828cbd4c81a3fb32f09a59043a8760e9c5
1 #! /usr/bin/sh
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright 2017 Nexenta Systems, Inc.
18 # Combine LC_CTYPE classes from all .UTF-8.src files to be compiled by localedef
19 # into one LC_CTYPE/LCL_DATA used by all locales, so we have the same case
20 # mapping tables, character classes, etc. for all of them. This is not general
21 # purpose parser but is good enough for the stock files supplied with CLDR.
23 printf "\nLC_CTYPE\n"
25 for i in upper lower alpha space cntrl graph print punct digit xdigit blank \
26 toupper tolower; do
27 # sed can't match both range patterns on the same line so we just make
28 # it look like valid multiline class by duplicating the definition
29 sed "/^$i.*>$/ {
30 s,$,;/,
32 s,^$i\(.*>\);/$,\1,
35 }" $@ |\
36 sed -n "/^$i/,/\([>)]\)$/ {
37 s,^$i,,
38 "'s,\([>)]\)$,\1;/,'"
39 /^$/d
41 }" |\
42 sort -u |\
43 sed "1 s,^,$i,;$ s,\([>)]\);/,\1,"
44 done
46 # Add the manually assembled definitions from FreeBSD
47 # (originally tools/tools/locale/etc/manual-input.UTF-8).
48 cat data/manual-input.UTF-8
50 printf "\nEND LC_CTYPE\n"