github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/geostd8.go (about) 1 // Copyright 2023 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 // Geostd8 represents the `geostd8` character set encoding. 18 var Geostd8 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 inputRange: rangeBounds{{128, 128}}, 29 outputRange: rangeBounds{{226, 226}, {130, 130}, {172, 172}}, 30 inputMults: []int{1}, 31 outputMults: []int{1, 1, 1}, 32 }, 33 { 34 inputRange: rangeBounds{{130, 130}}, 35 outputRange: rangeBounds{{226, 226}, {128, 128}, {154, 154}}, 36 inputMults: []int{1}, 37 outputMults: []int{1, 1, 1}, 38 }, 39 { 40 inputRange: rangeBounds{{132, 132}}, 41 outputRange: rangeBounds{{226, 226}, {128, 128}, {158, 158}}, 42 inputMults: []int{1}, 43 outputMults: []int{1, 1, 1}, 44 }, 45 { 46 inputRange: rangeBounds{{133, 133}}, 47 outputRange: rangeBounds{{226, 226}, {128, 128}, {166, 166}}, 48 inputMults: []int{1}, 49 outputMults: []int{1, 1, 1}, 50 }, 51 { 52 inputRange: rangeBounds{{134, 135}}, 53 outputRange: rangeBounds{{226, 226}, {128, 128}, {160, 161}}, 54 inputMults: []int{1}, 55 outputMults: []int{2, 2, 1}, 56 }, 57 { 58 inputRange: rangeBounds{{137, 137}}, 59 outputRange: rangeBounds{{226, 226}, {128, 128}, {176, 176}}, 60 inputMults: []int{1}, 61 outputMults: []int{1, 1, 1}, 62 }, 63 { 64 inputRange: rangeBounds{{139, 139}}, 65 outputRange: rangeBounds{{226, 226}, {128, 128}, {185, 185}}, 66 inputMults: []int{1}, 67 outputMults: []int{1, 1, 1}, 68 }, 69 { 70 inputRange: rangeBounds{{145, 146}}, 71 outputRange: rangeBounds{{226, 226}, {128, 128}, {152, 153}}, 72 inputMults: []int{1}, 73 outputMults: []int{2, 2, 1}, 74 }, 75 { 76 inputRange: rangeBounds{{147, 148}}, 77 outputRange: rangeBounds{{226, 226}, {128, 128}, {156, 157}}, 78 inputMults: []int{1}, 79 outputMults: []int{2, 2, 1}, 80 }, 81 { 82 inputRange: rangeBounds{{149, 149}}, 83 outputRange: rangeBounds{{226, 226}, {128, 128}, {162, 162}}, 84 inputMults: []int{1}, 85 outputMults: []int{1, 1, 1}, 86 }, 87 { 88 inputRange: rangeBounds{{150, 151}}, 89 outputRange: rangeBounds{{226, 226}, {128, 128}, {147, 148}}, 90 inputMults: []int{1}, 91 outputMults: []int{2, 2, 1}, 92 }, 93 { 94 inputRange: rangeBounds{{155, 155}}, 95 outputRange: rangeBounds{{226, 226}, {128, 128}, {186, 186}}, 96 inputMults: []int{1}, 97 outputMults: []int{1, 1, 1}, 98 }, 99 { 100 inputRange: rangeBounds{{160, 191}}, 101 outputRange: rangeBounds{{194, 194}, {160, 191}}, 102 inputMults: []int{1}, 103 outputMults: []int{32, 1}, 104 }, 105 { 106 inputRange: rangeBounds{{192, 198}}, 107 outputRange: rangeBounds{{225, 225}, {131, 131}, {144, 150}}, 108 inputMults: []int{1}, 109 outputMults: []int{7, 7, 1}, 110 }, 111 { 112 inputRange: rangeBounds{{199, 199}}, 113 outputRange: rangeBounds{{225, 225}, {131, 131}, {177, 177}}, 114 inputMults: []int{1}, 115 outputMults: []int{1, 1, 1}, 116 }, 117 { 118 inputRange: rangeBounds{{200, 205}}, 119 outputRange: rangeBounds{{225, 225}, {131, 131}, {151, 156}}, 120 inputMults: []int{1}, 121 outputMults: []int{6, 6, 1}, 122 }, 123 { 124 inputRange: rangeBounds{{206, 206}}, 125 outputRange: rangeBounds{{225, 225}, {131, 131}, {178, 178}}, 126 inputMults: []int{1}, 127 outputMults: []int{1, 1, 1}, 128 }, 129 { 130 inputRange: rangeBounds{{207, 212}}, 131 outputRange: rangeBounds{{225, 225}, {131, 131}, {157, 162}}, 132 inputMults: []int{1}, 133 outputMults: []int{6, 6, 1}, 134 }, 135 { 136 inputRange: rangeBounds{{213, 213}}, 137 outputRange: rangeBounds{{225, 225}, {131, 131}, {179, 179}}, 138 inputMults: []int{1}, 139 outputMults: []int{1, 1, 1}, 140 }, 141 { 142 inputRange: rangeBounds{{214, 225}}, 143 outputRange: rangeBounds{{225, 225}, {131, 131}, {163, 174}}, 144 inputMults: []int{1}, 145 outputMults: []int{12, 12, 1}, 146 }, 147 { 148 inputRange: rangeBounds{{226, 226}}, 149 outputRange: rangeBounds{{225, 225}, {131, 131}, {180, 180}}, 150 inputMults: []int{1}, 151 outputMults: []int{1, 1, 1}, 152 }, 153 { 154 inputRange: rangeBounds{{227, 228}}, 155 outputRange: rangeBounds{{225, 225}, {131, 131}, {175, 176}}, 156 inputMults: []int{1}, 157 outputMults: []int{2, 2, 1}, 158 }, 159 { 160 inputRange: rangeBounds{{229, 229}}, 161 outputRange: rangeBounds{{225, 225}, {131, 131}, {181, 181}}, 162 inputMults: []int{1}, 163 outputMults: []int{1, 1, 1}, 164 }, 165 { 166 inputRange: rangeBounds{{253, 253}}, 167 outputRange: rangeBounds{{226, 226}, {132, 132}, {150, 150}}, 168 inputMults: []int{1}, 169 outputMults: []int{1, 1, 1}, 170 }, 171 }, 172 nil, 173 nil, 174 nil, 175 }, 176 outputEntries: [][]rangeMapEntry{ 177 { 178 { 179 inputRange: rangeBounds{{0, 127}}, 180 outputRange: rangeBounds{{0, 127}}, 181 inputMults: []int{1}, 182 outputMults: []int{1}, 183 }, 184 }, 185 { 186 { 187 inputRange: rangeBounds{{160, 191}}, 188 outputRange: rangeBounds{{194, 194}, {160, 191}}, 189 inputMults: []int{1}, 190 outputMults: []int{32, 1}, 191 }, 192 }, 193 { 194 { 195 inputRange: rangeBounds{{128, 128}}, 196 outputRange: rangeBounds{{226, 226}, {130, 130}, {172, 172}}, 197 inputMults: []int{1}, 198 outputMults: []int{1, 1, 1}, 199 }, 200 { 201 inputRange: rangeBounds{{130, 130}}, 202 outputRange: rangeBounds{{226, 226}, {128, 128}, {154, 154}}, 203 inputMults: []int{1}, 204 outputMults: []int{1, 1, 1}, 205 }, 206 { 207 inputRange: rangeBounds{{132, 132}}, 208 outputRange: rangeBounds{{226, 226}, {128, 128}, {158, 158}}, 209 inputMults: []int{1}, 210 outputMults: []int{1, 1, 1}, 211 }, 212 { 213 inputRange: rangeBounds{{133, 133}}, 214 outputRange: rangeBounds{{226, 226}, {128, 128}, {166, 166}}, 215 inputMults: []int{1}, 216 outputMults: []int{1, 1, 1}, 217 }, 218 { 219 inputRange: rangeBounds{{134, 135}}, 220 outputRange: rangeBounds{{226, 226}, {128, 128}, {160, 161}}, 221 inputMults: []int{1}, 222 outputMults: []int{2, 2, 1}, 223 }, 224 { 225 inputRange: rangeBounds{{137, 137}}, 226 outputRange: rangeBounds{{226, 226}, {128, 128}, {176, 176}}, 227 inputMults: []int{1}, 228 outputMults: []int{1, 1, 1}, 229 }, 230 { 231 inputRange: rangeBounds{{139, 139}}, 232 outputRange: rangeBounds{{226, 226}, {128, 128}, {185, 185}}, 233 inputMults: []int{1}, 234 outputMults: []int{1, 1, 1}, 235 }, 236 { 237 inputRange: rangeBounds{{145, 146}}, 238 outputRange: rangeBounds{{226, 226}, {128, 128}, {152, 153}}, 239 inputMults: []int{1}, 240 outputMults: []int{2, 2, 1}, 241 }, 242 { 243 inputRange: rangeBounds{{147, 148}}, 244 outputRange: rangeBounds{{226, 226}, {128, 128}, {156, 157}}, 245 inputMults: []int{1}, 246 outputMults: []int{2, 2, 1}, 247 }, 248 { 249 inputRange: rangeBounds{{149, 149}}, 250 outputRange: rangeBounds{{226, 226}, {128, 128}, {162, 162}}, 251 inputMults: []int{1}, 252 outputMults: []int{1, 1, 1}, 253 }, 254 { 255 inputRange: rangeBounds{{150, 151}}, 256 outputRange: rangeBounds{{226, 226}, {128, 128}, {147, 148}}, 257 inputMults: []int{1}, 258 outputMults: []int{2, 2, 1}, 259 }, 260 { 261 inputRange: rangeBounds{{155, 155}}, 262 outputRange: rangeBounds{{226, 226}, {128, 128}, {186, 186}}, 263 inputMults: []int{1}, 264 outputMults: []int{1, 1, 1}, 265 }, 266 { 267 inputRange: rangeBounds{{192, 198}}, 268 outputRange: rangeBounds{{225, 225}, {131, 131}, {144, 150}}, 269 inputMults: []int{1}, 270 outputMults: []int{7, 7, 1}, 271 }, 272 { 273 inputRange: rangeBounds{{199, 199}}, 274 outputRange: rangeBounds{{225, 225}, {131, 131}, {177, 177}}, 275 inputMults: []int{1}, 276 outputMults: []int{1, 1, 1}, 277 }, 278 { 279 inputRange: rangeBounds{{200, 205}}, 280 outputRange: rangeBounds{{225, 225}, {131, 131}, {151, 156}}, 281 inputMults: []int{1}, 282 outputMults: []int{6, 6, 1}, 283 }, 284 { 285 inputRange: rangeBounds{{206, 206}}, 286 outputRange: rangeBounds{{225, 225}, {131, 131}, {178, 178}}, 287 inputMults: []int{1}, 288 outputMults: []int{1, 1, 1}, 289 }, 290 { 291 inputRange: rangeBounds{{207, 212}}, 292 outputRange: rangeBounds{{225, 225}, {131, 131}, {157, 162}}, 293 inputMults: []int{1}, 294 outputMults: []int{6, 6, 1}, 295 }, 296 { 297 inputRange: rangeBounds{{213, 213}}, 298 outputRange: rangeBounds{{225, 225}, {131, 131}, {179, 179}}, 299 inputMults: []int{1}, 300 outputMults: []int{1, 1, 1}, 301 }, 302 { 303 inputRange: rangeBounds{{214, 225}}, 304 outputRange: rangeBounds{{225, 225}, {131, 131}, {163, 174}}, 305 inputMults: []int{1}, 306 outputMults: []int{12, 12, 1}, 307 }, 308 { 309 inputRange: rangeBounds{{226, 226}}, 310 outputRange: rangeBounds{{225, 225}, {131, 131}, {180, 180}}, 311 inputMults: []int{1}, 312 outputMults: []int{1, 1, 1}, 313 }, 314 { 315 inputRange: rangeBounds{{227, 228}}, 316 outputRange: rangeBounds{{225, 225}, {131, 131}, {175, 176}}, 317 inputMults: []int{1}, 318 outputMults: []int{2, 2, 1}, 319 }, 320 { 321 inputRange: rangeBounds{{229, 229}}, 322 outputRange: rangeBounds{{225, 225}, {131, 131}, {181, 181}}, 323 inputMults: []int{1}, 324 outputMults: []int{1, 1, 1}, 325 }, 326 { 327 inputRange: rangeBounds{{253, 253}}, 328 outputRange: rangeBounds{{226, 226}, {132, 132}, {150, 150}}, 329 inputMults: []int{1}, 330 outputMults: []int{1, 1, 1}, 331 }, 332 }, 333 nil, 334 }, 335 toUpper: map[rune]rune{ 336 97: 65, 337 98: 66, 338 99: 67, 339 100: 68, 340 101: 69, 341 102: 70, 342 103: 71, 343 104: 72, 344 105: 73, 345 106: 74, 346 107: 75, 347 108: 76, 348 109: 77, 349 110: 78, 350 111: 79, 351 112: 80, 352 113: 81, 353 114: 82, 354 115: 83, 355 116: 84, 356 117: 85, 357 118: 86, 358 119: 87, 359 120: 88, 360 121: 89, 361 122: 90, 362 }, 363 toLower: map[rune]rune{ 364 65: 97, 365 66: 98, 366 67: 99, 367 68: 100, 368 69: 101, 369 70: 102, 370 71: 103, 371 72: 104, 372 73: 105, 373 74: 106, 374 75: 107, 375 76: 108, 376 77: 109, 377 78: 110, 378 79: 111, 379 80: 112, 380 81: 113, 381 82: 114, 382 83: 115, 383 84: 116, 384 85: 117, 385 86: 118, 386 87: 119, 387 88: 120, 388 89: 121, 389 90: 122, 390 }, 391 }