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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
|
<h1> Package unicode </h1> <ul id="short-nav">
<li><code>import "unicode"</code></li>
<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
<li><a href="#pkg-index" class="indexLink">Index</a></li>
<li><a href="#pkg-examples" class="examplesLink">Examples</a></li>
<li><a href="#pkg-subdirectories">Subdirectories</a></li>
</ul> <h2 id="pkg-overview">Overview </h2> <p>Package unicode provides data and functions to test some properties of Unicode code points. </p> <h4 id="example__is"> <span class="text">Example (Is)</span>
</h4> <p>Functions starting with "Is" can be used to inspect which table of range a rune belongs to. Note that runes may fit into more than one range. </p> <p>Code:</p> <pre class="code" data-language="go">// constant with mixed type runes
const mixed = "\b5Ὂg̀9! ℃ᾭG"
for _, c := range mixed {
fmt.Printf("For %q:\n", c)
if unicode.IsControl(c) {
fmt.Println("\tis control rune")
}
if unicode.IsDigit(c) {
fmt.Println("\tis digit rune")
}
if unicode.IsGraphic(c) {
fmt.Println("\tis graphic rune")
}
if unicode.IsLetter(c) {
fmt.Println("\tis letter rune")
}
if unicode.IsLower(c) {
fmt.Println("\tis lower case rune")
}
if unicode.IsMark(c) {
fmt.Println("\tis mark rune")
}
if unicode.IsNumber(c) {
fmt.Println("\tis number rune")
}
if unicode.IsPrint(c) {
fmt.Println("\tis printable rune")
}
if !unicode.IsPrint(c) {
fmt.Println("\tis not printable rune")
}
if unicode.IsPunct(c) {
fmt.Println("\tis punct rune")
}
if unicode.IsSpace(c) {
fmt.Println("\tis space rune")
}
if unicode.IsSymbol(c) {
fmt.Println("\tis symbol rune")
}
if unicode.IsTitle(c) {
fmt.Println("\tis title case rune")
}
if unicode.IsUpper(c) {
fmt.Println("\tis upper case rune")
}
}
</pre> <p>Output:</p> <pre class="output" data-language="go">For '\b':
is control rune
is not printable rune
For '5':
is digit rune
is graphic rune
is number rune
is printable rune
For 'Ὂ':
is graphic rune
is letter rune
is printable rune
is upper case rune
For 'g':
is graphic rune
is letter rune
is lower case rune
is printable rune
For '̀':
is graphic rune
is mark rune
is printable rune
For '9':
is digit rune
is graphic rune
is number rune
is printable rune
For '!':
is graphic rune
is printable rune
is punct rune
For ' ':
is graphic rune
is printable rune
is space rune
For '℃':
is graphic rune
is printable rune
is symbol rune
For 'ᾭ':
is graphic rune
is letter rune
is printable rune
is title case rune
For 'G':
is graphic rune
is letter rune
is printable rune
is upper case rune
</pre> <h2 id="pkg-index">Index </h2> <ul id="manual-nav">
<li><a href="#pkg-constants">Constants</a></li>
<li><a href="#pkg-variables">Variables</a></li>
<li><a href="#In">func In(r rune, ranges ...*RangeTable) bool</a></li>
<li><a href="#Is">func Is(rangeTab *RangeTable, r rune) bool</a></li>
<li><a href="#IsControl">func IsControl(r rune) bool</a></li>
<li><a href="#IsDigit">func IsDigit(r rune) bool</a></li>
<li><a href="#IsGraphic">func IsGraphic(r rune) bool</a></li>
<li><a href="#IsLetter">func IsLetter(r rune) bool</a></li>
<li><a href="#IsLower">func IsLower(r rune) bool</a></li>
<li><a href="#IsMark">func IsMark(r rune) bool</a></li>
<li><a href="#IsNumber">func IsNumber(r rune) bool</a></li>
<li><a href="#IsOneOf">func IsOneOf(ranges []*RangeTable, r rune) bool</a></li>
<li><a href="#IsPrint">func IsPrint(r rune) bool</a></li>
<li><a href="#IsPunct">func IsPunct(r rune) bool</a></li>
<li><a href="#IsSpace">func IsSpace(r rune) bool</a></li>
<li><a href="#IsSymbol">func IsSymbol(r rune) bool</a></li>
<li><a href="#IsTitle">func IsTitle(r rune) bool</a></li>
<li><a href="#IsUpper">func IsUpper(r rune) bool</a></li>
<li><a href="#SimpleFold">func SimpleFold(r rune) rune</a></li>
<li><a href="#To">func To(_case int, r rune) rune</a></li>
<li><a href="#ToLower">func ToLower(r rune) rune</a></li>
<li><a href="#ToTitle">func ToTitle(r rune) rune</a></li>
<li><a href="#ToUpper">func ToUpper(r rune) rune</a></li>
<li><a href="#CaseRange">type CaseRange</a></li>
<li><a href="#Range16">type Range16</a></li>
<li><a href="#Range32">type Range32</a></li>
<li><a href="#RangeTable">type RangeTable</a></li>
<li><a href="#SpecialCase">type SpecialCase</a></li>
<li> <a href="#SpecialCase.ToLower">func (special SpecialCase) ToLower(r rune) rune</a>
</li>
<li> <a href="#SpecialCase.ToTitle">func (special SpecialCase) ToTitle(r rune) rune</a>
</li>
<li> <a href="#SpecialCase.ToUpper">func (special SpecialCase) ToUpper(r rune) rune</a>
</li>
<li><a href="#pkg-note-BUG">Bugs</a></li>
</ul> <div id="pkg-examples"> <h3>Examples</h3> <dl> <dd><a class="exampleLink" href="#example_IsDigit">IsDigit</a></dd> <dd><a class="exampleLink" href="#example_IsLetter">IsLetter</a></dd> <dd><a class="exampleLink" href="#example_IsLower">IsLower</a></dd> <dd><a class="exampleLink" href="#example_IsNumber">IsNumber</a></dd> <dd><a class="exampleLink" href="#example_IsSpace">IsSpace</a></dd> <dd><a class="exampleLink" href="#example_IsTitle">IsTitle</a></dd> <dd><a class="exampleLink" href="#example_IsUpper">IsUpper</a></dd> <dd><a class="exampleLink" href="#example_SimpleFold">SimpleFold</a></dd> <dd><a class="exampleLink" href="#example_SpecialCase">SpecialCase</a></dd> <dd><a class="exampleLink" href="#example_To">To</a></dd> <dd><a class="exampleLink" href="#example_ToLower">ToLower</a></dd> <dd><a class="exampleLink" href="#example_ToTitle">ToTitle</a></dd> <dd><a class="exampleLink" href="#example_ToUpper">ToUpper</a></dd> <dd><a class="exampleLink" href="#example__is">Package (Is)</a></dd> </dl> </div> <h3>Package files</h3> <p> <span>casetables.go</span> <span>digit.go</span> <span>graphic.go</span> <span>letter.go</span> <span>tables.go</span> </p> <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
MaxRune = '\U0010FFFF' // Maximum valid Unicode code point.
ReplacementChar = '\uFFFD' // Represents invalid code points.
MaxASCII = '\u007F' // maximum ASCII value.
MaxLatin1 = '\u00FF' // maximum Latin-1 value.
)</pre> <p>Indices into the Delta arrays inside CaseRanges for case mapping. </p>
<pre data-language="go">const (
UpperCase = iota
LowerCase
TitleCase
MaxCase
)</pre> <p>If the Delta field of a <a href="#CaseRange">CaseRange</a> is UpperLower, it means this CaseRange represents a sequence of the form (say) <a href="#Upper">Upper</a> <a href="#Lower">Lower</a> <a href="#Upper">Upper</a> <a href="#Lower">Lower</a>. </p>
<pre data-language="go">const (
UpperLower = MaxRune + 1 // (Cannot be a valid delta.)
)</pre> <p>Version is the Unicode edition from which the tables are derived. </p>
<pre data-language="go">const Version = "15.0.0"</pre> <h2 id="pkg-variables">Variables</h2> <p>These variables have type *RangeTable. </p>
<pre data-language="go">var (
Cc = _Cc // Cc is the set of Unicode characters in category Cc (Other, control).
Cf = _Cf // Cf is the set of Unicode characters in category Cf (Other, format).
Co = _Co // Co is the set of Unicode characters in category Co (Other, private use).
Cs = _Cs // Cs is the set of Unicode characters in category Cs (Other, surrogate).
Digit = _Nd // Digit is the set of Unicode characters with the "decimal digit" property.
Nd = _Nd // Nd is the set of Unicode characters in category Nd (Number, decimal digit).
Letter = _L // Letter/L is the set of Unicode letters, category L.
L = _L
Lm = _Lm // Lm is the set of Unicode characters in category Lm (Letter, modifier).
Lo = _Lo // Lo is the set of Unicode characters in category Lo (Letter, other).
Lower = _Ll // Lower is the set of Unicode lower case letters.
Ll = _Ll // Ll is the set of Unicode characters in category Ll (Letter, lowercase).
Mark = _M // Mark/M is the set of Unicode mark characters, category M.
M = _M
Mc = _Mc // Mc is the set of Unicode characters in category Mc (Mark, spacing combining).
Me = _Me // Me is the set of Unicode characters in category Me (Mark, enclosing).
Mn = _Mn // Mn is the set of Unicode characters in category Mn (Mark, nonspacing).
Nl = _Nl // Nl is the set of Unicode characters in category Nl (Number, letter).
No = _No // No is the set of Unicode characters in category No (Number, other).
Number = _N // Number/N is the set of Unicode number characters, category N.
N = _N
Other = _C // Other/C is the set of Unicode control and special characters, category C.
C = _C
Pc = _Pc // Pc is the set of Unicode characters in category Pc (Punctuation, connector).
Pd = _Pd // Pd is the set of Unicode characters in category Pd (Punctuation, dash).
Pe = _Pe // Pe is the set of Unicode characters in category Pe (Punctuation, close).
Pf = _Pf // Pf is the set of Unicode characters in category Pf (Punctuation, final quote).
Pi = _Pi // Pi is the set of Unicode characters in category Pi (Punctuation, initial quote).
Po = _Po // Po is the set of Unicode characters in category Po (Punctuation, other).
Ps = _Ps // Ps is the set of Unicode characters in category Ps (Punctuation, open).
Punct = _P // Punct/P is the set of Unicode punctuation characters, category P.
P = _P
Sc = _Sc // Sc is the set of Unicode characters in category Sc (Symbol, currency).
Sk = _Sk // Sk is the set of Unicode characters in category Sk (Symbol, modifier).
Sm = _Sm // Sm is the set of Unicode characters in category Sm (Symbol, math).
So = _So // So is the set of Unicode characters in category So (Symbol, other).
Space = _Z // Space/Z is the set of Unicode space characters, category Z.
Z = _Z
Symbol = _S // Symbol/S is the set of Unicode symbol characters, category S.
S = _S
Title = _Lt // Title is the set of Unicode title case letters.
Lt = _Lt // Lt is the set of Unicode characters in category Lt (Letter, titlecase).
Upper = _Lu // Upper is the set of Unicode upper case letters.
Lu = _Lu // Lu is the set of Unicode characters in category Lu (Letter, uppercase).
Zl = _Zl // Zl is the set of Unicode characters in category Zl (Separator, line).
Zp = _Zp // Zp is the set of Unicode characters in category Zp (Separator, paragraph).
Zs = _Zs // Zs is the set of Unicode characters in category Zs (Separator, space).
)</pre> <p>These variables have type *RangeTable. </p>
<pre data-language="go">var (
Adlam = _Adlam // Adlam is the set of Unicode characters in script Adlam.
Ahom = _Ahom // Ahom is the set of Unicode characters in script Ahom.
Anatolian_Hieroglyphs = _Anatolian_Hieroglyphs // Anatolian_Hieroglyphs is the set of Unicode characters in script Anatolian_Hieroglyphs.
Arabic = _Arabic // Arabic is the set of Unicode characters in script Arabic.
Armenian = _Armenian // Armenian is the set of Unicode characters in script Armenian.
Avestan = _Avestan // Avestan is the set of Unicode characters in script Avestan.
Balinese = _Balinese // Balinese is the set of Unicode characters in script Balinese.
Bamum = _Bamum // Bamum is the set of Unicode characters in script Bamum.
Bassa_Vah = _Bassa_Vah // Bassa_Vah is the set of Unicode characters in script Bassa_Vah.
Batak = _Batak // Batak is the set of Unicode characters in script Batak.
Bengali = _Bengali // Bengali is the set of Unicode characters in script Bengali.
Bhaiksuki = _Bhaiksuki // Bhaiksuki is the set of Unicode characters in script Bhaiksuki.
Bopomofo = _Bopomofo // Bopomofo is the set of Unicode characters in script Bopomofo.
Brahmi = _Brahmi // Brahmi is the set of Unicode characters in script Brahmi.
Braille = _Braille // Braille is the set of Unicode characters in script Braille.
Buginese = _Buginese // Buginese is the set of Unicode characters in script Buginese.
Buhid = _Buhid // Buhid is the set of Unicode characters in script Buhid.
Canadian_Aboriginal = _Canadian_Aboriginal // Canadian_Aboriginal is the set of Unicode characters in script Canadian_Aboriginal.
Carian = _Carian // Carian is the set of Unicode characters in script Carian.
Caucasian_Albanian = _Caucasian_Albanian // Caucasian_Albanian is the set of Unicode characters in script Caucasian_Albanian.
Chakma = _Chakma // Chakma is the set of Unicode characters in script Chakma.
Cham = _Cham // Cham is the set of Unicode characters in script Cham.
Cherokee = _Cherokee // Cherokee is the set of Unicode characters in script Cherokee.
Chorasmian = _Chorasmian // Chorasmian is the set of Unicode characters in script Chorasmian.
Common = _Common // Common is the set of Unicode characters in script Common.
Coptic = _Coptic // Coptic is the set of Unicode characters in script Coptic.
Cuneiform = _Cuneiform // Cuneiform is the set of Unicode characters in script Cuneiform.
Cypriot = _Cypriot // Cypriot is the set of Unicode characters in script Cypriot.
Cypro_Minoan = _Cypro_Minoan // Cypro_Minoan is the set of Unicode characters in script Cypro_Minoan.
Cyrillic = _Cyrillic // Cyrillic is the set of Unicode characters in script Cyrillic.
Deseret = _Deseret // Deseret is the set of Unicode characters in script Deseret.
Devanagari = _Devanagari // Devanagari is the set of Unicode characters in script Devanagari.
Dives_Akuru = _Dives_Akuru // Dives_Akuru is the set of Unicode characters in script Dives_Akuru.
Dogra = _Dogra // Dogra is the set of Unicode characters in script Dogra.
Duployan = _Duployan // Duployan is the set of Unicode characters in script Duployan.
Egyptian_Hieroglyphs = _Egyptian_Hieroglyphs // Egyptian_Hieroglyphs is the set of Unicode characters in script Egyptian_Hieroglyphs.
Elbasan = _Elbasan // Elbasan is the set of Unicode characters in script Elbasan.
Elymaic = _Elymaic // Elymaic is the set of Unicode characters in script Elymaic.
Ethiopic = _Ethiopic // Ethiopic is the set of Unicode characters in script Ethiopic.
Georgian = _Georgian // Georgian is the set of Unicode characters in script Georgian.
Glagolitic = _Glagolitic // Glagolitic is the set of Unicode characters in script Glagolitic.
Gothic = _Gothic // Gothic is the set of Unicode characters in script Gothic.
Grantha = _Grantha // Grantha is the set of Unicode characters in script Grantha.
Greek = _Greek // Greek is the set of Unicode characters in script Greek.
Gujarati = _Gujarati // Gujarati is the set of Unicode characters in script Gujarati.
Gunjala_Gondi = _Gunjala_Gondi // Gunjala_Gondi is the set of Unicode characters in script Gunjala_Gondi.
Gurmukhi = _Gurmukhi // Gurmukhi is the set of Unicode characters in script Gurmukhi.
Han = _Han // Han is the set of Unicode characters in script Han.
Hangul = _Hangul // Hangul is the set of Unicode characters in script Hangul.
Hanifi_Rohingya = _Hanifi_Rohingya // Hanifi_Rohingya is the set of Unicode characters in script Hanifi_Rohingya.
Hanunoo = _Hanunoo // Hanunoo is the set of Unicode characters in script Hanunoo.
Hatran = _Hatran // Hatran is the set of Unicode characters in script Hatran.
Hebrew = _Hebrew // Hebrew is the set of Unicode characters in script Hebrew.
Hiragana = _Hiragana // Hiragana is the set of Unicode characters in script Hiragana.
Imperial_Aramaic = _Imperial_Aramaic // Imperial_Aramaic is the set of Unicode characters in script Imperial_Aramaic.
Inherited = _Inherited // Inherited is the set of Unicode characters in script Inherited.
Inscriptional_Pahlavi = _Inscriptional_Pahlavi // Inscriptional_Pahlavi is the set of Unicode characters in script Inscriptional_Pahlavi.
Inscriptional_Parthian = _Inscriptional_Parthian // Inscriptional_Parthian is the set of Unicode characters in script Inscriptional_Parthian.
Javanese = _Javanese // Javanese is the set of Unicode characters in script Javanese.
Kaithi = _Kaithi // Kaithi is the set of Unicode characters in script Kaithi.
Kannada = _Kannada // Kannada is the set of Unicode characters in script Kannada.
Katakana = _Katakana // Katakana is the set of Unicode characters in script Katakana.
Kawi = _Kawi // Kawi is the set of Unicode characters in script Kawi.
Kayah_Li = _Kayah_Li // Kayah_Li is the set of Unicode characters in script Kayah_Li.
Kharoshthi = _Kharoshthi // Kharoshthi is the set of Unicode characters in script Kharoshthi.
Khitan_Small_Script = _Khitan_Small_Script // Khitan_Small_Script is the set of Unicode characters in script Khitan_Small_Script.
Khmer = _Khmer // Khmer is the set of Unicode characters in script Khmer.
Khojki = _Khojki // Khojki is the set of Unicode characters in script Khojki.
Khudawadi = _Khudawadi // Khudawadi is the set of Unicode characters in script Khudawadi.
Lao = _Lao // Lao is the set of Unicode characters in script Lao.
Latin = _Latin // Latin is the set of Unicode characters in script Latin.
Lepcha = _Lepcha // Lepcha is the set of Unicode characters in script Lepcha.
Limbu = _Limbu // Limbu is the set of Unicode characters in script Limbu.
Linear_A = _Linear_A // Linear_A is the set of Unicode characters in script Linear_A.
Linear_B = _Linear_B // Linear_B is the set of Unicode characters in script Linear_B.
Lisu = _Lisu // Lisu is the set of Unicode characters in script Lisu.
Lycian = _Lycian // Lycian is the set of Unicode characters in script Lycian.
Lydian = _Lydian // Lydian is the set of Unicode characters in script Lydian.
Mahajani = _Mahajani // Mahajani is the set of Unicode characters in script Mahajani.
Makasar = _Makasar // Makasar is the set of Unicode characters in script Makasar.
Malayalam = _Malayalam // Malayalam is the set of Unicode characters in script Malayalam.
Mandaic = _Mandaic // Mandaic is the set of Unicode characters in script Mandaic.
Manichaean = _Manichaean // Manichaean is the set of Unicode characters in script Manichaean.
Marchen = _Marchen // Marchen is the set of Unicode characters in script Marchen.
Masaram_Gondi = _Masaram_Gondi // Masaram_Gondi is the set of Unicode characters in script Masaram_Gondi.
Medefaidrin = _Medefaidrin // Medefaidrin is the set of Unicode characters in script Medefaidrin.
Meetei_Mayek = _Meetei_Mayek // Meetei_Mayek is the set of Unicode characters in script Meetei_Mayek.
Mende_Kikakui = _Mende_Kikakui // Mende_Kikakui is the set of Unicode characters in script Mende_Kikakui.
Meroitic_Cursive = _Meroitic_Cursive // Meroitic_Cursive is the set of Unicode characters in script Meroitic_Cursive.
Meroitic_Hieroglyphs = _Meroitic_Hieroglyphs // Meroitic_Hieroglyphs is the set of Unicode characters in script Meroitic_Hieroglyphs.
Miao = _Miao // Miao is the set of Unicode characters in script Miao.
Modi = _Modi // Modi is the set of Unicode characters in script Modi.
Mongolian = _Mongolian // Mongolian is the set of Unicode characters in script Mongolian.
Mro = _Mro // Mro is the set of Unicode characters in script Mro.
Multani = _Multani // Multani is the set of Unicode characters in script Multani.
Myanmar = _Myanmar // Myanmar is the set of Unicode characters in script Myanmar.
Nabataean = _Nabataean // Nabataean is the set of Unicode characters in script Nabataean.
Nag_Mundari = _Nag_Mundari // Nag_Mundari is the set of Unicode characters in script Nag_Mundari.
Nandinagari = _Nandinagari // Nandinagari is the set of Unicode characters in script Nandinagari.
New_Tai_Lue = _New_Tai_Lue // New_Tai_Lue is the set of Unicode characters in script New_Tai_Lue.
Newa = _Newa // Newa is the set of Unicode characters in script Newa.
Nko = _Nko // Nko is the set of Unicode characters in script Nko.
Nushu = _Nushu // Nushu is the set of Unicode characters in script Nushu.
Nyiakeng_Puachue_Hmong = _Nyiakeng_Puachue_Hmong // Nyiakeng_Puachue_Hmong is the set of Unicode characters in script Nyiakeng_Puachue_Hmong.
Ogham = _Ogham // Ogham is the set of Unicode characters in script Ogham.
Ol_Chiki = _Ol_Chiki // Ol_Chiki is the set of Unicode characters in script Ol_Chiki.
Old_Hungarian = _Old_Hungarian // Old_Hungarian is the set of Unicode characters in script Old_Hungarian.
Old_Italic = _Old_Italic // Old_Italic is the set of Unicode characters in script Old_Italic.
Old_North_Arabian = _Old_North_Arabian // Old_North_Arabian is the set of Unicode characters in script Old_North_Arabian.
Old_Permic = _Old_Permic // Old_Permic is the set of Unicode characters in script Old_Permic.
Old_Persian = _Old_Persian // Old_Persian is the set of Unicode characters in script Old_Persian.
Old_Sogdian = _Old_Sogdian // Old_Sogdian is the set of Unicode characters in script Old_Sogdian.
Old_South_Arabian = _Old_South_Arabian // Old_South_Arabian is the set of Unicode characters in script Old_South_Arabian.
Old_Turkic = _Old_Turkic // Old_Turkic is the set of Unicode characters in script Old_Turkic.
Old_Uyghur = _Old_Uyghur // Old_Uyghur is the set of Unicode characters in script Old_Uyghur.
Oriya = _Oriya // Oriya is the set of Unicode characters in script Oriya.
Osage = _Osage // Osage is the set of Unicode characters in script Osage.
Osmanya = _Osmanya // Osmanya is the set of Unicode characters in script Osmanya.
Pahawh_Hmong = _Pahawh_Hmong // Pahawh_Hmong is the set of Unicode characters in script Pahawh_Hmong.
Palmyrene = _Palmyrene // Palmyrene is the set of Unicode characters in script Palmyrene.
Pau_Cin_Hau = _Pau_Cin_Hau // Pau_Cin_Hau is the set of Unicode characters in script Pau_Cin_Hau.
Phags_Pa = _Phags_Pa // Phags_Pa is the set of Unicode characters in script Phags_Pa.
Phoenician = _Phoenician // Phoenician is the set of Unicode characters in script Phoenician.
Psalter_Pahlavi = _Psalter_Pahlavi // Psalter_Pahlavi is the set of Unicode characters in script Psalter_Pahlavi.
Rejang = _Rejang // Rejang is the set of Unicode characters in script Rejang.
Runic = _Runic // Runic is the set of Unicode characters in script Runic.
Samaritan = _Samaritan // Samaritan is the set of Unicode characters in script Samaritan.
Saurashtra = _Saurashtra // Saurashtra is the set of Unicode characters in script Saurashtra.
Sharada = _Sharada // Sharada is the set of Unicode characters in script Sharada.
Shavian = _Shavian // Shavian is the set of Unicode characters in script Shavian.
Siddham = _Siddham // Siddham is the set of Unicode characters in script Siddham.
SignWriting = _SignWriting // SignWriting is the set of Unicode characters in script SignWriting.
Sinhala = _Sinhala // Sinhala is the set of Unicode characters in script Sinhala.
Sogdian = _Sogdian // Sogdian is the set of Unicode characters in script Sogdian.
Sora_Sompeng = _Sora_Sompeng // Sora_Sompeng is the set of Unicode characters in script Sora_Sompeng.
Soyombo = _Soyombo // Soyombo is the set of Unicode characters in script Soyombo.
Sundanese = _Sundanese // Sundanese is the set of Unicode characters in script Sundanese.
Syloti_Nagri = _Syloti_Nagri // Syloti_Nagri is the set of Unicode characters in script Syloti_Nagri.
Syriac = _Syriac // Syriac is the set of Unicode characters in script Syriac.
Tagalog = _Tagalog // Tagalog is the set of Unicode characters in script Tagalog.
Tagbanwa = _Tagbanwa // Tagbanwa is the set of Unicode characters in script Tagbanwa.
Tai_Le = _Tai_Le // Tai_Le is the set of Unicode characters in script Tai_Le.
Tai_Tham = _Tai_Tham // Tai_Tham is the set of Unicode characters in script Tai_Tham.
Tai_Viet = _Tai_Viet // Tai_Viet is the set of Unicode characters in script Tai_Viet.
Takri = _Takri // Takri is the set of Unicode characters in script Takri.
Tamil = _Tamil // Tamil is the set of Unicode characters in script Tamil.
Tangsa = _Tangsa // Tangsa is the set of Unicode characters in script Tangsa.
Tangut = _Tangut // Tangut is the set of Unicode characters in script Tangut.
Telugu = _Telugu // Telugu is the set of Unicode characters in script Telugu.
Thaana = _Thaana // Thaana is the set of Unicode characters in script Thaana.
Thai = _Thai // Thai is the set of Unicode characters in script Thai.
Tibetan = _Tibetan // Tibetan is the set of Unicode characters in script Tibetan.
Tifinagh = _Tifinagh // Tifinagh is the set of Unicode characters in script Tifinagh.
Tirhuta = _Tirhuta // Tirhuta is the set of Unicode characters in script Tirhuta.
Toto = _Toto // Toto is the set of Unicode characters in script Toto.
Ugaritic = _Ugaritic // Ugaritic is the set of Unicode characters in script Ugaritic.
Vai = _Vai // Vai is the set of Unicode characters in script Vai.
Vithkuqi = _Vithkuqi // Vithkuqi is the set of Unicode characters in script Vithkuqi.
Wancho = _Wancho // Wancho is the set of Unicode characters in script Wancho.
Warang_Citi = _Warang_Citi // Warang_Citi is the set of Unicode characters in script Warang_Citi.
Yezidi = _Yezidi // Yezidi is the set of Unicode characters in script Yezidi.
Yi = _Yi // Yi is the set of Unicode characters in script Yi.
Zanabazar_Square = _Zanabazar_Square // Zanabazar_Square is the set of Unicode characters in script Zanabazar_Square.
)</pre> <p>These variables have type *RangeTable. </p>
<pre data-language="go">var (
ASCII_Hex_Digit = _ASCII_Hex_Digit // ASCII_Hex_Digit is the set of Unicode characters with property ASCII_Hex_Digit.
Bidi_Control = _Bidi_Control // Bidi_Control is the set of Unicode characters with property Bidi_Control.
Dash = _Dash // Dash is the set of Unicode characters with property Dash.
Deprecated = _Deprecated // Deprecated is the set of Unicode characters with property Deprecated.
Diacritic = _Diacritic // Diacritic is the set of Unicode characters with property Diacritic.
Extender = _Extender // Extender is the set of Unicode characters with property Extender.
Hex_Digit = _Hex_Digit // Hex_Digit is the set of Unicode characters with property Hex_Digit.
Hyphen = _Hyphen // Hyphen is the set of Unicode characters with property Hyphen.
IDS_Binary_Operator = _IDS_Binary_Operator // IDS_Binary_Operator is the set of Unicode characters with property IDS_Binary_Operator.
IDS_Trinary_Operator = _IDS_Trinary_Operator // IDS_Trinary_Operator is the set of Unicode characters with property IDS_Trinary_Operator.
Ideographic = _Ideographic // Ideographic is the set of Unicode characters with property Ideographic.
Join_Control = _Join_Control // Join_Control is the set of Unicode characters with property Join_Control.
Logical_Order_Exception = _Logical_Order_Exception // Logical_Order_Exception is the set of Unicode characters with property Logical_Order_Exception.
Noncharacter_Code_Point = _Noncharacter_Code_Point // Noncharacter_Code_Point is the set of Unicode characters with property Noncharacter_Code_Point.
Other_Alphabetic = _Other_Alphabetic // Other_Alphabetic is the set of Unicode characters with property Other_Alphabetic.
Other_Default_Ignorable_Code_Point = _Other_Default_Ignorable_Code_Point // Other_Default_Ignorable_Code_Point is the set of Unicode characters with property Other_Default_Ignorable_Code_Point.
Other_Grapheme_Extend = _Other_Grapheme_Extend // Other_Grapheme_Extend is the set of Unicode characters with property Other_Grapheme_Extend.
Other_ID_Continue = _Other_ID_Continue // Other_ID_Continue is the set of Unicode characters with property Other_ID_Continue.
Other_ID_Start = _Other_ID_Start // Other_ID_Start is the set of Unicode characters with property Other_ID_Start.
Other_Lowercase = _Other_Lowercase // Other_Lowercase is the set of Unicode characters with property Other_Lowercase.
Other_Math = _Other_Math // Other_Math is the set of Unicode characters with property Other_Math.
Other_Uppercase = _Other_Uppercase // Other_Uppercase is the set of Unicode characters with property Other_Uppercase.
Pattern_Syntax = _Pattern_Syntax // Pattern_Syntax is the set of Unicode characters with property Pattern_Syntax.
Pattern_White_Space = _Pattern_White_Space // Pattern_White_Space is the set of Unicode characters with property Pattern_White_Space.
Prepended_Concatenation_Mark = _Prepended_Concatenation_Mark // Prepended_Concatenation_Mark is the set of Unicode characters with property Prepended_Concatenation_Mark.
Quotation_Mark = _Quotation_Mark // Quotation_Mark is the set of Unicode characters with property Quotation_Mark.
Radical = _Radical // Radical is the set of Unicode characters with property Radical.
Regional_Indicator = _Regional_Indicator // Regional_Indicator is the set of Unicode characters with property Regional_Indicator.
STerm = _Sentence_Terminal // STerm is an alias for Sentence_Terminal.
Sentence_Terminal = _Sentence_Terminal // Sentence_Terminal is the set of Unicode characters with property Sentence_Terminal.
Soft_Dotted = _Soft_Dotted // Soft_Dotted is the set of Unicode characters with property Soft_Dotted.
Terminal_Punctuation = _Terminal_Punctuation // Terminal_Punctuation is the set of Unicode characters with property Terminal_Punctuation.
Unified_Ideograph = _Unified_Ideograph // Unified_Ideograph is the set of Unicode characters with property Unified_Ideograph.
Variation_Selector = _Variation_Selector // Variation_Selector is the set of Unicode characters with property Variation_Selector.
White_Space = _White_Space // White_Space is the set of Unicode characters with property White_Space.
)</pre> <p>CaseRanges is the table describing case mappings for all letters with non-self mappings. </p>
<pre data-language="go">var CaseRanges = _CaseRanges</pre> <p>Categories is the set of Unicode category tables. </p>
<pre data-language="go">var Categories = map[string]*RangeTable{
"C": C,
"Cc": Cc,
"Cf": Cf,
"Co": Co,
"Cs": Cs,
"L": L,
"Ll": Ll,
"Lm": Lm,
"Lo": Lo,
"Lt": Lt,
"Lu": Lu,
"M": M,
"Mc": Mc,
"Me": Me,
"Mn": Mn,
"N": N,
"Nd": Nd,
"Nl": Nl,
"No": No,
"P": P,
"Pc": Pc,
"Pd": Pd,
"Pe": Pe,
"Pf": Pf,
"Pi": Pi,
"Po": Po,
"Ps": Ps,
"S": S,
"Sc": Sc,
"Sk": Sk,
"Sm": Sm,
"So": So,
"Z": Z,
"Zl": Zl,
"Zp": Zp,
"Zs": Zs,
}</pre> <p>FoldCategory maps a category name to a table of code points outside the category that are equivalent under simple case folding to code points inside the category. If there is no entry for a category name, there are no such points. </p>
<pre data-language="go">var FoldCategory = map[string]*RangeTable{
"L": foldL,
"Ll": foldLl,
"Lt": foldLt,
"Lu": foldLu,
"M": foldM,
"Mn": foldMn,
}</pre> <p>FoldScript maps a script name to a table of code points outside the script that are equivalent under simple case folding to code points inside the script. If there is no entry for a script name, there are no such points. </p>
<pre data-language="go">var FoldScript = map[string]*RangeTable{
"Common": foldCommon,
"Greek": foldGreek,
"Inherited": foldInherited,
}</pre> <p>GraphicRanges defines the set of graphic characters according to Unicode. </p>
<pre data-language="go">var GraphicRanges = []*RangeTable{
L, M, N, P, S, Zs,
}</pre> <p>PrintRanges defines the set of printable characters according to Go. ASCII space, U+0020, is handled separately. </p>
<pre data-language="go">var PrintRanges = []*RangeTable{
L, M, N, P, S,
}</pre> <p>Properties is the set of Unicode property tables. </p>
<pre data-language="go">var Properties = map[string]*RangeTable{
"ASCII_Hex_Digit": ASCII_Hex_Digit,
"Bidi_Control": Bidi_Control,
"Dash": Dash,
"Deprecated": Deprecated,
"Diacritic": Diacritic,
"Extender": Extender,
"Hex_Digit": Hex_Digit,
"Hyphen": Hyphen,
"IDS_Binary_Operator": IDS_Binary_Operator,
"IDS_Trinary_Operator": IDS_Trinary_Operator,
"Ideographic": Ideographic,
"Join_Control": Join_Control,
"Logical_Order_Exception": Logical_Order_Exception,
"Noncharacter_Code_Point": Noncharacter_Code_Point,
"Other_Alphabetic": Other_Alphabetic,
"Other_Default_Ignorable_Code_Point": Other_Default_Ignorable_Code_Point,
"Other_Grapheme_Extend": Other_Grapheme_Extend,
"Other_ID_Continue": Other_ID_Continue,
"Other_ID_Start": Other_ID_Start,
"Other_Lowercase": Other_Lowercase,
"Other_Math": Other_Math,
"Other_Uppercase": Other_Uppercase,
"Pattern_Syntax": Pattern_Syntax,
"Pattern_White_Space": Pattern_White_Space,
"Prepended_Concatenation_Mark": Prepended_Concatenation_Mark,
"Quotation_Mark": Quotation_Mark,
"Radical": Radical,
"Regional_Indicator": Regional_Indicator,
"Sentence_Terminal": Sentence_Terminal,
"STerm": Sentence_Terminal,
"Soft_Dotted": Soft_Dotted,
"Terminal_Punctuation": Terminal_Punctuation,
"Unified_Ideograph": Unified_Ideograph,
"Variation_Selector": Variation_Selector,
"White_Space": White_Space,
}</pre> <p>Scripts is the set of Unicode script tables. </p>
<pre data-language="go">var Scripts = map[string]*RangeTable{
"Adlam": Adlam,
"Ahom": Ahom,
"Anatolian_Hieroglyphs": Anatolian_Hieroglyphs,
"Arabic": Arabic,
"Armenian": Armenian,
"Avestan": Avestan,
"Balinese": Balinese,
"Bamum": Bamum,
"Bassa_Vah": Bassa_Vah,
"Batak": Batak,
"Bengali": Bengali,
"Bhaiksuki": Bhaiksuki,
"Bopomofo": Bopomofo,
"Brahmi": Brahmi,
"Braille": Braille,
"Buginese": Buginese,
"Buhid": Buhid,
"Canadian_Aboriginal": Canadian_Aboriginal,
"Carian": Carian,
"Caucasian_Albanian": Caucasian_Albanian,
"Chakma": Chakma,
"Cham": Cham,
"Cherokee": Cherokee,
"Chorasmian": Chorasmian,
"Common": Common,
"Coptic": Coptic,
"Cuneiform": Cuneiform,
"Cypriot": Cypriot,
"Cypro_Minoan": Cypro_Minoan,
"Cyrillic": Cyrillic,
"Deseret": Deseret,
"Devanagari": Devanagari,
"Dives_Akuru": Dives_Akuru,
"Dogra": Dogra,
"Duployan": Duployan,
"Egyptian_Hieroglyphs": Egyptian_Hieroglyphs,
"Elbasan": Elbasan,
"Elymaic": Elymaic,
"Ethiopic": Ethiopic,
"Georgian": Georgian,
"Glagolitic": Glagolitic,
"Gothic": Gothic,
"Grantha": Grantha,
"Greek": Greek,
"Gujarati": Gujarati,
"Gunjala_Gondi": Gunjala_Gondi,
"Gurmukhi": Gurmukhi,
"Han": Han,
"Hangul": Hangul,
"Hanifi_Rohingya": Hanifi_Rohingya,
"Hanunoo": Hanunoo,
"Hatran": Hatran,
"Hebrew": Hebrew,
"Hiragana": Hiragana,
"Imperial_Aramaic": Imperial_Aramaic,
"Inherited": Inherited,
"Inscriptional_Pahlavi": Inscriptional_Pahlavi,
"Inscriptional_Parthian": Inscriptional_Parthian,
"Javanese": Javanese,
"Kaithi": Kaithi,
"Kannada": Kannada,
"Katakana": Katakana,
"Kawi": Kawi,
"Kayah_Li": Kayah_Li,
"Kharoshthi": Kharoshthi,
"Khitan_Small_Script": Khitan_Small_Script,
"Khmer": Khmer,
"Khojki": Khojki,
"Khudawadi": Khudawadi,
"Lao": Lao,
"Latin": Latin,
"Lepcha": Lepcha,
"Limbu": Limbu,
"Linear_A": Linear_A,
"Linear_B": Linear_B,
"Lisu": Lisu,
"Lycian": Lycian,
"Lydian": Lydian,
"Mahajani": Mahajani,
"Makasar": Makasar,
"Malayalam": Malayalam,
"Mandaic": Mandaic,
"Manichaean": Manichaean,
"Marchen": Marchen,
"Masaram_Gondi": Masaram_Gondi,
"Medefaidrin": Medefaidrin,
"Meetei_Mayek": Meetei_Mayek,
"Mende_Kikakui": Mende_Kikakui,
"Meroitic_Cursive": Meroitic_Cursive,
"Meroitic_Hieroglyphs": Meroitic_Hieroglyphs,
"Miao": Miao,
"Modi": Modi,
"Mongolian": Mongolian,
"Mro": Mro,
"Multani": Multani,
"Myanmar": Myanmar,
"Nabataean": Nabataean,
"Nag_Mundari": Nag_Mundari,
"Nandinagari": Nandinagari,
"New_Tai_Lue": New_Tai_Lue,
"Newa": Newa,
"Nko": Nko,
"Nushu": Nushu,
"Nyiakeng_Puachue_Hmong": Nyiakeng_Puachue_Hmong,
"Ogham": Ogham,
"Ol_Chiki": Ol_Chiki,
"Old_Hungarian": Old_Hungarian,
"Old_Italic": Old_Italic,
"Old_North_Arabian": Old_North_Arabian,
"Old_Permic": Old_Permic,
"Old_Persian": Old_Persian,
"Old_Sogdian": Old_Sogdian,
"Old_South_Arabian": Old_South_Arabian,
"Old_Turkic": Old_Turkic,
"Old_Uyghur": Old_Uyghur,
"Oriya": Oriya,
"Osage": Osage,
"Osmanya": Osmanya,
"Pahawh_Hmong": Pahawh_Hmong,
"Palmyrene": Palmyrene,
"Pau_Cin_Hau": Pau_Cin_Hau,
"Phags_Pa": Phags_Pa,
"Phoenician": Phoenician,
"Psalter_Pahlavi": Psalter_Pahlavi,
"Rejang": Rejang,
"Runic": Runic,
"Samaritan": Samaritan,
"Saurashtra": Saurashtra,
"Sharada": Sharada,
"Shavian": Shavian,
"Siddham": Siddham,
"SignWriting": SignWriting,
"Sinhala": Sinhala,
"Sogdian": Sogdian,
"Sora_Sompeng": Sora_Sompeng,
"Soyombo": Soyombo,
"Sundanese": Sundanese,
"Syloti_Nagri": Syloti_Nagri,
"Syriac": Syriac,
"Tagalog": Tagalog,
"Tagbanwa": Tagbanwa,
"Tai_Le": Tai_Le,
"Tai_Tham": Tai_Tham,
"Tai_Viet": Tai_Viet,
"Takri": Takri,
"Tamil": Tamil,
"Tangsa": Tangsa,
"Tangut": Tangut,
"Telugu": Telugu,
"Thaana": Thaana,
"Thai": Thai,
"Tibetan": Tibetan,
"Tifinagh": Tifinagh,
"Tirhuta": Tirhuta,
"Toto": Toto,
"Ugaritic": Ugaritic,
"Vai": Vai,
"Vithkuqi": Vithkuqi,
"Wancho": Wancho,
"Warang_Citi": Warang_Citi,
"Yezidi": Yezidi,
"Yi": Yi,
"Zanabazar_Square": Zanabazar_Square,
}</pre> <h2 id="In">func <span>In</span> <span title="Added in Go 1.2">1.2</span> </h2> <pre data-language="go">func In(r rune, ranges ...*RangeTable) bool</pre> <p>In reports whether the rune is a member of one of the ranges. </p>
<h2 id="Is">func <span>Is</span> </h2> <pre data-language="go">func Is(rangeTab *RangeTable, r rune) bool</pre> <p>Is reports whether the rune is in the specified table of ranges. </p>
<h2 id="IsControl">func <span>IsControl</span> </h2> <pre data-language="go">func IsControl(r rune) bool</pre> <p>IsControl reports whether the rune is a control character. The <a href="#C">C</a> (<a href="#Other">Other</a>) Unicode category includes more code points such as surrogates; use <a href="#Is">Is</a>(C, r) to test for them. </p>
<h2 id="IsDigit">func <span>IsDigit</span> </h2> <pre data-language="go">func IsDigit(r rune) bool</pre> <p>IsDigit reports whether the rune is a decimal digit. </p> <h4 id="example_IsDigit"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsDigit('৩'))
fmt.Printf("%t\n", unicode.IsDigit('A'))
</pre> <p>Output:</p> <pre class="output" data-language="go">true
false
</pre> <h2 id="IsGraphic">func <span>IsGraphic</span> </h2> <pre data-language="go">func IsGraphic(r rune) bool</pre> <p>IsGraphic reports whether the rune is defined as a Graphic by Unicode. Such characters include letters, marks, numbers, punctuation, symbols, and spaces, from categories <a href="#L">L</a>, <a href="#M">M</a>, <a href="#N">N</a>, <a href="#P">P</a>, <a href="#S">S</a>, <a href="#Zs">Zs</a>. </p>
<h2 id="IsLetter">func <span>IsLetter</span> </h2> <pre data-language="go">func IsLetter(r rune) bool</pre> <p>IsLetter reports whether the rune is a letter (category <a href="#L">L</a>). </p> <h4 id="example_IsLetter"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsLetter('A'))
fmt.Printf("%t\n", unicode.IsLetter('7'))
</pre> <p>Output:</p> <pre class="output" data-language="go">true
false
</pre> <h2 id="IsLower">func <span>IsLower</span> </h2> <pre data-language="go">func IsLower(r rune) bool</pre> <p>IsLower reports whether the rune is a lower case letter. </p> <h4 id="example_IsLower"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsLower('a'))
fmt.Printf("%t\n", unicode.IsLower('A'))
</pre> <p>Output:</p> <pre class="output" data-language="go">true
false
</pre> <h2 id="IsMark">func <span>IsMark</span> </h2> <pre data-language="go">func IsMark(r rune) bool</pre> <p>IsMark reports whether the rune is a mark character (category <a href="#M">M</a>). </p>
<h2 id="IsNumber">func <span>IsNumber</span> </h2> <pre data-language="go">func IsNumber(r rune) bool</pre> <p>IsNumber reports whether the rune is a number (category <a href="#N">N</a>). </p> <h4 id="example_IsNumber"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsNumber('Ⅷ'))
fmt.Printf("%t\n", unicode.IsNumber('A'))
</pre> <p>Output:</p> <pre class="output" data-language="go">true
false
</pre> <h2 id="IsOneOf">func <span>IsOneOf</span> </h2> <pre data-language="go">func IsOneOf(ranges []*RangeTable, r rune) bool</pre> <p>IsOneOf reports whether the rune is a member of one of the ranges. The function "In" provides a nicer signature and should be used in preference to IsOneOf. </p>
<h2 id="IsPrint">func <span>IsPrint</span> </h2> <pre data-language="go">func IsPrint(r rune) bool</pre> <p>IsPrint reports whether the rune is defined as printable by Go. Such characters include letters, marks, numbers, punctuation, symbols, and the ASCII space character, from categories <a href="#L">L</a>, <a href="#M">M</a>, <a href="#N">N</a>, <a href="#P">P</a>, <a href="#S">S</a> and the ASCII space character. This categorization is the same as <a href="#IsGraphic">IsGraphic</a> except that the only spacing character is ASCII space, U+0020. </p>
<h2 id="IsPunct">func <span>IsPunct</span> </h2> <pre data-language="go">func IsPunct(r rune) bool</pre> <p>IsPunct reports whether the rune is a Unicode punctuation character (category <a href="#P">P</a>). </p>
<h2 id="IsSpace">func <span>IsSpace</span> </h2> <pre data-language="go">func IsSpace(r rune) bool</pre> <p>IsSpace reports whether the rune is a space character as defined by Unicode's White Space property; in the Latin-1 space this is </p>
<pre data-language="go">'\t', '\n', '\v', '\f', '\r', ' ', U+0085 (NEL), U+00A0 (NBSP).
</pre> <p>Other definitions of spacing characters are set by category Z and property <a href="#Pattern_White_Space">Pattern_White_Space</a>. </p> <h4 id="example_IsSpace"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsSpace(' '))
fmt.Printf("%t\n", unicode.IsSpace('\n'))
fmt.Printf("%t\n", unicode.IsSpace('\t'))
fmt.Printf("%t\n", unicode.IsSpace('a'))
</pre> <p>Output:</p> <pre class="output" data-language="go">true
true
true
false
</pre> <h2 id="IsSymbol">func <span>IsSymbol</span> </h2> <pre data-language="go">func IsSymbol(r rune) bool</pre> <p>IsSymbol reports whether the rune is a symbolic character. </p>
<h2 id="IsTitle">func <span>IsTitle</span> </h2> <pre data-language="go">func IsTitle(r rune) bool</pre> <p>IsTitle reports whether the rune is a title case letter. </p> <h4 id="example_IsTitle"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsTitle('Dž'))
fmt.Printf("%t\n", unicode.IsTitle('a'))
</pre> <p>Output:</p> <pre class="output" data-language="go">true
false
</pre> <h2 id="IsUpper">func <span>IsUpper</span> </h2> <pre data-language="go">func IsUpper(r rune) bool</pre> <p>IsUpper reports whether the rune is an upper case letter. </p> <h4 id="example_IsUpper"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%t\n", unicode.IsUpper('A'))
fmt.Printf("%t\n", unicode.IsUpper('a'))
</pre> <p>Output:</p> <pre class="output" data-language="go">true
false
</pre> <h2 id="SimpleFold">func <span>SimpleFold</span> </h2> <pre data-language="go">func SimpleFold(r rune) rune</pre> <p>SimpleFold iterates over Unicode code points equivalent under the Unicode-defined simple case folding. Among the code points equivalent to rune (including rune itself), SimpleFold returns the smallest rune > r if one exists, or else the smallest rune >= 0. If r is not a valid Unicode code point, SimpleFold(r) returns r. </p>
<p>For example: </p>
<pre data-language="go">SimpleFold('A') = 'a'
SimpleFold('a') = 'A'
SimpleFold('K') = 'k'
SimpleFold('k') = '\u212A' (Kelvin symbol, K)
SimpleFold('\u212A') = 'K'
SimpleFold('1') = '1'
SimpleFold(-2) = -2
</pre> <h4 id="example_SimpleFold"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">fmt.Printf("%#U\n", unicode.SimpleFold('A')) // 'a'
fmt.Printf("%#U\n", unicode.SimpleFold('a')) // 'A'
fmt.Printf("%#U\n", unicode.SimpleFold('K')) // 'k'
fmt.Printf("%#U\n", unicode.SimpleFold('k')) // '\u212A' (Kelvin symbol, K)
fmt.Printf("%#U\n", unicode.SimpleFold('\u212A')) // 'K'
fmt.Printf("%#U\n", unicode.SimpleFold('1')) // '1'
</pre> <p>Output:</p> <pre class="output" data-language="go">U+0061 'a'
U+0041 'A'
U+006B 'k'
U+212A 'K'
U+004B 'K'
U+0031 '1'
</pre> <h2 id="To">func <span>To</span> </h2> <pre data-language="go">func To(_case int, r rune) rune</pre> <p>To maps the rune to the specified case: <a href="#UpperCase">UpperCase</a>, <a href="#LowerCase">LowerCase</a>, or <a href="#TitleCase">TitleCase</a>. </p> <h4 id="example_To"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">const lcG = 'g'
fmt.Printf("%#U\n", unicode.To(unicode.UpperCase, lcG))
fmt.Printf("%#U\n", unicode.To(unicode.LowerCase, lcG))
fmt.Printf("%#U\n", unicode.To(unicode.TitleCase, lcG))
const ucG = 'G'
fmt.Printf("%#U\n", unicode.To(unicode.UpperCase, ucG))
fmt.Printf("%#U\n", unicode.To(unicode.LowerCase, ucG))
fmt.Printf("%#U\n", unicode.To(unicode.TitleCase, ucG))
</pre> <p>Output:</p> <pre class="output" data-language="go">U+0047 'G'
U+0067 'g'
U+0047 'G'
U+0047 'G'
U+0067 'g'
U+0047 'G'
</pre> <h2 id="ToLower">func <span>ToLower</span> </h2> <pre data-language="go">func ToLower(r rune) rune</pre> <p>ToLower maps the rune to lower case. </p> <h4 id="example_ToLower"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">const ucG = 'G'
fmt.Printf("%#U\n", unicode.ToLower(ucG))
</pre> <p>Output:</p> <pre class="output" data-language="go">U+0067 'g'
</pre> <h2 id="ToTitle">func <span>ToTitle</span> </h2> <pre data-language="go">func ToTitle(r rune) rune</pre> <p>ToTitle maps the rune to title case. </p> <h4 id="example_ToTitle"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">const ucG = 'g'
fmt.Printf("%#U\n", unicode.ToTitle(ucG))
</pre> <p>Output:</p> <pre class="output" data-language="go">U+0047 'G'
</pre> <h2 id="ToUpper">func <span>ToUpper</span> </h2> <pre data-language="go">func ToUpper(r rune) rune</pre> <p>ToUpper maps the rune to upper case. </p> <h4 id="example_ToUpper"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">const ucG = 'g'
fmt.Printf("%#U\n", unicode.ToUpper(ucG))
</pre> <p>Output:</p> <pre class="output" data-language="go">U+0047 'G'
</pre> <h2 id="CaseRange">type <span>CaseRange</span> </h2> <p>CaseRange represents a range of Unicode code points for simple (one code point to one code point) case conversion. The range runs from Lo to Hi inclusive, with a fixed stride of 1. Deltas are the number to add to the code point to reach the code point for a different case for that character. They may be negative. If zero, it means the character is in the corresponding case. There is a special case representing sequences of alternating corresponding Upper and Lower pairs. It appears with a fixed Delta of </p>
<pre data-language="go">{UpperLower, UpperLower, UpperLower}
</pre> <p>The constant UpperLower has an otherwise impossible delta value. </p>
<pre data-language="go">type CaseRange struct {
Lo uint32
Hi uint32
Delta d
}
</pre> <h2 id="Range16">type <span>Range16</span> </h2> <p>Range16 represents of a range of 16-bit Unicode code points. The range runs from Lo to Hi inclusive and has the specified stride. </p>
<pre data-language="go">type Range16 struct {
Lo uint16
Hi uint16
Stride uint16
}
</pre> <h2 id="Range32">type <span>Range32</span> </h2> <p>Range32 represents of a range of Unicode code points and is used when one or more of the values will not fit in 16 bits. The range runs from Lo to Hi inclusive and has the specified stride. Lo and Hi must always be >= 1<<16. </p>
<pre data-language="go">type Range32 struct {
Lo uint32
Hi uint32
Stride uint32
}
</pre> <h2 id="RangeTable">type <span>RangeTable</span> </h2> <p>RangeTable defines a set of Unicode code points by listing the ranges of code points within the set. The ranges are listed in two slices to save space: a slice of 16-bit ranges and a slice of 32-bit ranges. The two slices must be in sorted order and non-overlapping. Also, R32 should contain only values >= 0x10000 (1<<16). </p>
<pre data-language="go">type RangeTable struct {
R16 []Range16
R32 []Range32
LatinOffset int // number of entries in R16 with Hi <= MaxLatin1; added in Go 1.1
}
</pre> <h2 id="SpecialCase">type <span>SpecialCase</span> </h2> <p>SpecialCase represents language-specific case mappings such as Turkish. Methods of SpecialCase customize (by overriding) the standard mappings. </p>
<pre data-language="go">type SpecialCase []CaseRange</pre> <pre data-language="go">var AzeriCase SpecialCase = _TurkishCase</pre> <pre data-language="go">var TurkishCase SpecialCase = _TurkishCase</pre> <h4 id="example_SpecialCase"> <span class="text">Example</span>
</h4> <p>Code:</p> <pre class="code" data-language="go">t := unicode.TurkishCase
const lci = 'i'
fmt.Printf("%#U\n", t.ToLower(lci))
fmt.Printf("%#U\n", t.ToTitle(lci))
fmt.Printf("%#U\n", t.ToUpper(lci))
const uci = 'İ'
fmt.Printf("%#U\n", t.ToLower(uci))
fmt.Printf("%#U\n", t.ToTitle(uci))
fmt.Printf("%#U\n", t.ToUpper(uci))
</pre> <p>Output:</p> <pre class="output" data-language="go">U+0069 'i'
U+0130 'İ'
U+0130 'İ'
U+0069 'i'
U+0130 'İ'
U+0130 'İ'
</pre> <h3 id="SpecialCase.ToLower">func (SpecialCase) <span>ToLower</span> </h3> <pre data-language="go">func (special SpecialCase) ToLower(r rune) rune</pre> <p>ToLower maps the rune to lower case giving priority to the special mapping. </p>
<h3 id="SpecialCase.ToTitle">func (SpecialCase) <span>ToTitle</span> </h3> <pre data-language="go">func (special SpecialCase) ToTitle(r rune) rune</pre> <p>ToTitle maps the rune to title case giving priority to the special mapping. </p>
<h3 id="SpecialCase.ToUpper">func (SpecialCase) <span>ToUpper</span> </h3> <pre data-language="go">func (special SpecialCase) ToUpper(r rune) rune</pre> <p>ToUpper maps the rune to upper case giving priority to the special mapping. </p>
<h2 id="pkg-note-BUG">Bugs</h2> <ul> <li>☞ <p>There is no mechanism for full case folding, that is, for characters that involve multiple runes in the input or output. </p>
</li> </ul> <h2 id="pkg-subdirectories">Subdirectories</h2> <div class="pkg-dir"> <table> <tr> <th class="pkg-name">Name</th> <th class="pkg-synopsis">Synopsis</th> </tr> <tr> <td colspan="2"><a href="../index">..</a></td> </tr> <tr> <td class="pkg-name"> <a href="utf16/index">utf16</a> </td> <td class="pkg-synopsis"> Package utf16 implements encoding and decoding of UTF-16 sequences. </td> </tr> <tr> <td class="pkg-name"> <a href="utf8/index">utf8</a> </td> <td class="pkg-synopsis"> Package utf8 implements functions and constants to support text encoded in UTF-8. </td> </tr> </table> </div><div class="_attribution">
<p class="_attribution-p">
© Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
<a href="http://golang.org/pkg/unicode/" class="_attribution-link">http://golang.org/pkg/unicode/</a>
</p>
</div>
|