blob: 479c55dda1b7877bf887669fed4d8169baeb777c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
#!/bin/bash
# Latin letter small capital a: UTF-8: e1 b4 80 UTF-16BE: 1d00
# .0 .1 .2 .3 .4 .5 .6 .7 .8 .9 .A .B .C .D .E .F
# 1D0. ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ
# 1D1. ᴐ ᴑ ᴒ ᴓ ᴔ ᴕ ᴖ ᴗ ᴘ ᴙ ᴚ ᴛ ᴜ ᴝ ᴞ ᴟ
# 1D2. ᴠ ᴡ ᴢ ᴣ ᴤ ᴥ ᴦ ᴧ ᴨ ᴩ ᴪ ᴫ ᴬ ᴭ ᴮ ᴯ
# 1D3. ᴰ ᴱ ᴲ ᴳ ᴴ ᴵ ᴶ ᴷ ᴸ ᴹ ᴺ ᴻ ᴼ ᴽ ᴾ ᴿ
# 1D4. ᵀ ᵁ ᵂ ᵃ ᵄ ᵅ ᵆ ᵇ ᵈ ᵉ ᵊ ᵋ ᵌ ᵍ ᵎ ᵏ
# 1D5. ᵐ ᵑ ᵒ ᵓ ᵔ ᵕ ᵖ ᵗ ᵘ ᵙ ᵚ ᵛ ᵜ ᵝ ᵞ ᵟ
# 1D6. ᵠ ᵡ ᵢ ᵣ ᵤ ᵥ ᵦ ᵧ ᵨ ᵩ ᵪ ᵫ ᵬ ᵭ ᵮ ᵯ
# 1D7. ᵰ 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
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
# []=$'\x1d\x'
)
while IFS= read -r line
do
replacement=""
for i in $(seq 0 "$((${#line}-1))")
do
c1=${line:$i:1}
# if [[ $c1 =~ [a-zA-Zα-ωΑ-Ω] ]]
if [[ $c1 =~ [a-zæœ] ]]
then replacement+=${smallcaps[$c1]}
else replacement+=$c1
fi
done
echo "$replacement"
done
|