github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/ascii.go (about) 1 // Copyright 2022 Dolthub, Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package encodings 16 17 // Ascii represents the `ascii` character set encoding. 18 var Ascii Encoder = &RangeMap{ 19 inputEntries: [][]rangeMapEntry{ 20 { 21 { 22 inputRange: rangeBounds{{0, 127}}, 23 outputRange: rangeBounds{{0, 127}}, 24 inputMults: []int{1}, 25 outputMults: []int{1}, 26 }, 27 }, 28 nil, 29 nil, 30 nil, 31 }, 32 outputEntries: [][]rangeMapEntry{ 33 { 34 { 35 inputRange: rangeBounds{{0, 127}}, 36 outputRange: rangeBounds{{0, 127}}, 37 inputMults: []int{1}, 38 outputMults: []int{1}, 39 }, 40 }, 41 nil, 42 nil, 43 nil, 44 }, 45 toUpper: map[rune]rune{ 46 97: 65, 47 98: 66, 48 99: 67, 49 100: 68, 50 101: 69, 51 102: 70, 52 103: 71, 53 104: 72, 54 105: 73, 55 106: 74, 56 107: 75, 57 108: 76, 58 109: 77, 59 110: 78, 60 111: 79, 61 112: 80, 62 113: 81, 63 114: 82, 64 115: 83, 65 116: 84, 66 117: 85, 67 118: 86, 68 119: 87, 69 120: 88, 70 121: 89, 71 122: 90, 72 }, 73 toLower: map[rune]rune{ 74 65: 97, 75 66: 98, 76 67: 99, 77 68: 100, 78 69: 101, 79 70: 102, 80 71: 103, 81 72: 104, 82 73: 105, 83 74: 106, 84 75: 107, 85 76: 108, 86 77: 109, 87 78: 110, 88 79: 111, 89 80: 112, 90 81: 113, 91 82: 114, 92 83: 115, 93 84: 116, 94 85: 117, 95 86: 118, 96 87: 119, 97 88: 120, 98 89: 121, 99 90: 122, 100 }, 101 }