Commit ID: 10053CBE5223B3319F3
CVSROOT: /cvs
Module name: contrib
Changes by: [email protected] 2014/07/20 15:49:41 UTC
Added files:
samples : uni_smp.txt
Log message:
# useful for SMP char grepping…
set -U
typeset -i1 j
while IFS= read -r line; do
typeset -Uui16 -Z11 wi=0x${line%%;*}
if (( wi < 0x10000 )); then
typeset -Uui16 -Z7 x=wi
(( j = (x < 32) || (x >= 0xD800 && x <= 0xDFFF) || \
(x >= 0xEF80 && x <= 0xEFFF) || (x > 0xFFFD) ? 1 : x ))
m=${j#1#}
n=${%m}
print -n "U+${x#16#} "
if (( n == -1 )); then
print -n " � "
elif (( n == 0 )); then
print -nr -- " $m "
elif (( n == 1 )); then
print -nr -- "$m "
elif (( n == 2 )); then
print -nr -- "$m "
else
print -u2 Fatal $k $n
exit 1
fi
else
print -n "U-${wi#16#} "
set +U
(( j = (wi >> 18) | 0xF0 ))
print -nr -- "${j#1#}"
(( j = ((wi >> 12) & 0x3F) | 0x80 ))
print -nr -- "${j#1#}"
(( j = ((wi >> 6) & 0x3F) | 0x80 ))
print -nr -- "${j#1#}"
(( j = (wi & 0x3F) | 0x80 ))
print -nr -- "${j#1#} "
set -U
fi
print -r -- "${line#*;}"
done <UnicodeData.txt
exit 0
To generate a diff of this changeset, execute the following commands:
cvs -R rdiff -kk -upr0 -r1.1 contrib/samples/uni_smp.txt