github.com/go-xe2/third@v1.0.3/golang.org/x/text/unicode/runenames/example_test.go (about) 1 // Copyright 2016 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package runenames_test 6 7 import ( 8 "fmt" 9 10 "github.com/go-xe2/third/golang.org/x/text/unicode/runenames" 11 ) 12 13 func Example() { 14 runes := []rune{ 15 -1, 16 '\U00000000', 17 '\U0000001f', 18 '\U00000020', 19 '\U00000021', 20 '\U00000041', 21 '\U0000007e', 22 '\U0000007f', 23 '\U00000080', 24 '\U000000e0', 25 26 '\U0000037f', 27 '\U00000380', 28 '\U00000381', 29 '\U00000382', 30 '\U00000383', 31 '\U00000384', 32 '\U00000385', 33 '\U00000386', 34 '\U000007c0', 35 36 '\U00002603', 37 '\U000033ff', 38 '\U00003400', 39 '\U00003401', 40 '\U00003402', 41 '\U00004dc0', 42 43 '\U00009fd5', 44 '\U00009fd6', 45 '\U00009fff', 46 '\U0000a000', 47 0xdc00, // '\U0000dc00' (Low Surrogate) is an invalid Go literal. 48 '\U0000f800', 49 '\U0000fffc', 50 '\U0000fffd', 51 '\U0000fffe', 52 '\U0000ffff', 53 54 '\U00010000', 55 '\U0001f574', 56 '\U0002fa1d', 57 '\U0002fa1e', 58 '\U000e0100', 59 '\U000e01ef', 60 '\U000e01f0', 61 '\U00100000', 62 '\U0010fffd', 63 '\U0010fffe', 64 '\U0010ffff', 65 } 66 67 for _, r := range runes { 68 fmt.Printf("%08x %q\n", r, runenames.Name(r)) 69 } 70 71 // Output: 72 // -0000001 "" 73 // 00000000 "<control>" 74 // 0000001f "<control>" 75 // 00000020 "SPACE" 76 // 00000021 "EXCLAMATION MARK" 77 // 00000041 "LATIN CAPITAL LETTER A" 78 // 0000007e "TILDE" 79 // 0000007f "<control>" 80 // 00000080 "<control>" 81 // 000000e0 "LATIN SMALL LETTER A WITH GRAVE" 82 // 0000037f "GREEK CAPITAL LETTER YOT" 83 // 00000380 "" 84 // 00000381 "" 85 // 00000382 "" 86 // 00000383 "" 87 // 00000384 "GREEK TONOS" 88 // 00000385 "GREEK DIALYTIKA TONOS" 89 // 00000386 "GREEK CAPITAL LETTER ALPHA WITH TONOS" 90 // 000007c0 "NKO DIGIT ZERO" 91 // 00002603 "SNOWMAN" 92 // 000033ff "SQUARE GAL" 93 // 00003400 "<CJK Ideograph Extension A>" 94 // 00003401 "<CJK Ideograph Extension A>" 95 // 00003402 "<CJK Ideograph Extension A>" 96 // 00004dc0 "HEXAGRAM FOR THE CREATIVE HEAVEN" 97 // 00009fd5 "<CJK Ideograph>" 98 // 00009fd6 "" 99 // 00009fff "" 100 // 0000a000 "YI SYLLABLE IT" 101 // 0000dc00 "<Low Surrogate>" 102 // 0000f800 "<Private Use>" 103 // 0000fffc "OBJECT REPLACEMENT CHARACTER" 104 // 0000fffd "REPLACEMENT CHARACTER" 105 // 0000fffe "" 106 // 0000ffff "" 107 // 00010000 "LINEAR B SYLLABLE B008 A" 108 // 0001f574 "MAN IN BUSINESS SUIT LEVITATING" 109 // 0002fa1d "CJK COMPATIBILITY IDEOGRAPH-2FA1D" 110 // 0002fa1e "" 111 // 000e0100 "VARIATION SELECTOR-17" 112 // 000e01ef "VARIATION SELECTOR-256" 113 // 000e01f0 "" 114 // 00100000 "<Plane 16 Private Use>" 115 // 0010fffd "<Plane 16 Private Use>" 116 // 0010fffe "" 117 // 0010ffff "" 118 }