github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/latin1_german2_ci.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 // Latin1_german2_ci_RuneWeight returns the weight of a given rune based on its relational sort order from 18 // the `latin1_german2_ci` collation. 19 func Latin1_german2_ci_RuneWeight(r rune) int32 { 20 weight, ok := latin1_german2_ci_Weights[r] 21 if ok { 22 return weight 23 } else { 24 return 2147483647 25 } 26 } 27 28 // latin1_german2_ci_Weights contain a map from rune to weight for the `latin1_german2_ci` collation. The 29 // map primarily contains mappings that have a random order. Mappings that fit into a sequential range (and are long 30 // enough) are defined in the calling function to save space. 31 var latin1_german2_ci_Weights = map[rune]int32{ 32 0: 0, 33 1: 1, 34 2: 2, 35 3: 3, 36 4: 4, 37 5: 5, 38 6: 6, 39 7: 7, 40 8: 8, 41 9: 9, 42 10: 10, 43 11: 11, 44 12: 12, 45 13: 13, 46 14: 14, 47 15: 15, 48 16: 16, 49 17: 17, 50 18: 18, 51 19: 19, 52 20: 20, 53 21: 21, 54 22: 22, 55 23: 23, 56 24: 24, 57 25: 25, 58 26: 26, 59 27: 27, 60 28: 28, 61 29: 29, 62 30: 30, 63 31: 31, 64 32: 32, 65 33: 33, 66 34: 34, 67 35: 35, 68 36: 36, 69 37: 37, 70 38: 38, 71 39: 39, 72 40: 40, 73 41: 41, 74 42: 42, 75 43: 43, 76 44: 44, 77 45: 45, 78 46: 46, 79 47: 47, 80 48: 48, 81 49: 49, 82 50: 50, 83 51: 51, 84 52: 52, 85 53: 53, 86 54: 54, 87 55: 55, 88 56: 56, 89 57: 57, 90 58: 58, 91 59: 59, 92 60: 60, 93 61: 61, 94 62: 62, 95 63: 63, 96 64: 64, 97 65: 65, 98 97: 65, 99 192: 65, 100 193: 65, 101 194: 65, 102 195: 65, 103 197: 65, 104 224: 65, 105 225: 65, 106 226: 65, 107 227: 65, 108 229: 65, 109 196: 66, 110 228: 66, 111 66: 67, 112 98: 67, 113 67: 68, 114 99: 68, 115 199: 68, 116 231: 68, 117 68: 69, 118 100: 69, 119 208: 69, 120 240: 69, 121 69: 70, 122 101: 70, 123 200: 70, 124 201: 70, 125 202: 70, 126 203: 70, 127 232: 70, 128 233: 70, 129 234: 70, 130 235: 70, 131 70: 71, 132 102: 71, 133 71: 72, 134 103: 72, 135 72: 73, 136 104: 73, 137 73: 74, 138 105: 74, 139 204: 74, 140 205: 74, 141 206: 74, 142 207: 74, 143 236: 74, 144 237: 74, 145 238: 74, 146 239: 74, 147 74: 75, 148 106: 75, 149 75: 76, 150 107: 76, 151 76: 77, 152 108: 77, 153 77: 78, 154 109: 78, 155 78: 79, 156 110: 79, 157 209: 79, 158 241: 79, 159 79: 80, 160 111: 80, 161 210: 80, 162 211: 80, 163 212: 80, 164 213: 80, 165 242: 80, 166 243: 80, 167 244: 80, 168 245: 80, 169 214: 81, 170 246: 81, 171 80: 82, 172 112: 82, 173 81: 83, 174 113: 83, 175 82: 84, 176 114: 84, 177 83: 85, 178 115: 85, 179 223: 86, 180 84: 87, 181 116: 87, 182 85: 88, 183 117: 88, 184 217: 88, 185 218: 88, 186 219: 88, 187 249: 88, 188 250: 88, 189 251: 88, 190 220: 89, 191 252: 89, 192 86: 90, 193 118: 90, 194 87: 91, 195 119: 91, 196 88: 92, 197 120: 92, 198 89: 93, 199 121: 93, 200 221: 93, 201 253: 93, 202 255: 93, 203 90: 94, 204 122: 94, 205 91: 95, 206 92: 96, 207 198: 96, 208 230: 96, 209 93: 97, 210 94: 98, 211 95: 99, 212 96: 100, 213 123: 101, 214 124: 102, 215 125: 103, 216 126: 104, 217 127: 105, 218 8364: 106, 219 129: 107, 220 8218: 108, 221 402: 109, 222 8222: 110, 223 8230: 111, 224 8224: 112, 225 8225: 113, 226 710: 114, 227 8240: 115, 228 352: 116, 229 8249: 117, 230 338: 118, 231 141: 119, 232 381: 120, 233 143: 121, 234 144: 122, 235 8216: 123, 236 8217: 124, 237 8220: 125, 238 8221: 126, 239 8226: 127, 240 8211: 128, 241 8212: 129, 242 732: 130, 243 8482: 131, 244 353: 132, 245 8250: 133, 246 339: 134, 247 157: 135, 248 382: 136, 249 376: 137, 250 160: 138, 251 161: 139, 252 162: 140, 253 163: 141, 254 164: 142, 255 165: 143, 256 166: 144, 257 167: 145, 258 168: 146, 259 169: 147, 260 170: 148, 261 171: 149, 262 172: 150, 263 173: 151, 264 174: 152, 265 175: 153, 266 176: 154, 267 177: 155, 268 178: 156, 269 179: 157, 270 180: 158, 271 181: 159, 272 182: 160, 273 183: 161, 274 184: 162, 275 185: 163, 276 186: 164, 277 187: 165, 278 188: 166, 279 189: 167, 280 190: 168, 281 191: 169, 282 215: 170, 283 216: 171, 284 248: 171, 285 222: 172, 286 254: 172, 287 247: 173, 288 }