github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/cp1257_general_ci.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 // Cp1257_general_ci_RuneWeight returns the weight of a given rune based on its relational sort order from 18 // the `cp1257_general_ci` collation. 19 func Cp1257_general_ci_RuneWeight(r rune) int32 { 20 weight, ok := cp1257_general_ci_Weights[r] 21 if ok { 22 return weight 23 } else { 24 return 2147483647 25 } 26 } 27 28 // cp1257_general_ci_Weights contain a map from rune to weight for the `cp1257_general_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 cp1257_general_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 196: 65, 100 197: 65, 101 198: 65, 102 228: 65, 103 229: 65, 104 230: 65, 105 256: 65, 106 257: 65, 107 260: 65, 108 261: 65, 109 66: 66, 110 98: 66, 111 67: 67, 112 99: 67, 113 262: 67, 114 263: 67, 115 268: 67, 116 269: 67, 117 68: 68, 118 100: 68, 119 69: 69, 120 101: 69, 121 201: 69, 122 233: 69, 123 274: 69, 124 275: 69, 125 278: 69, 126 279: 69, 127 280: 69, 128 281: 69, 129 70: 70, 130 102: 70, 131 71: 71, 132 103: 71, 133 290: 71, 134 291: 71, 135 72: 72, 136 104: 72, 137 73: 73, 138 105: 73, 139 298: 73, 140 299: 73, 141 302: 73, 142 303: 73, 143 74: 74, 144 106: 74, 145 75: 75, 146 107: 75, 147 310: 75, 148 311: 75, 149 76: 76, 150 108: 76, 151 315: 76, 152 316: 76, 153 321: 76, 154 322: 76, 155 77: 77, 156 109: 77, 157 78: 78, 158 110: 78, 159 323: 78, 160 324: 78, 161 325: 78, 162 326: 78, 163 79: 79, 164 111: 79, 165 211: 79, 166 213: 79, 167 214: 79, 168 216: 79, 169 243: 79, 170 245: 79, 171 246: 79, 172 248: 79, 173 332: 79, 174 333: 79, 175 80: 80, 176 112: 80, 177 81: 81, 178 113: 81, 179 82: 82, 180 114: 82, 181 342: 82, 182 343: 82, 183 83: 83, 184 115: 83, 185 223: 83, 186 346: 83, 187 347: 83, 188 352: 83, 189 353: 83, 190 84: 84, 191 116: 84, 192 85: 85, 193 117: 85, 194 220: 85, 195 252: 85, 196 362: 85, 197 363: 85, 198 370: 85, 199 371: 85, 200 86: 86, 201 118: 86, 202 87: 87, 203 119: 87, 204 88: 88, 205 120: 88, 206 89: 89, 207 121: 89, 208 90: 90, 209 122: 90, 210 377: 90, 211 378: 90, 212 379: 90, 213 380: 90, 214 381: 90, 215 382: 90, 216 91: 91, 217 92: 92, 218 93: 93, 219 94: 94, 220 95: 95, 221 96: 96, 222 123: 97, 223 124: 98, 224 125: 99, 225 126: 100, 226 215: 101, 227 247: 102, 228 127: 103, 229 8364: 104, 230 8218: 105, 231 8222: 106, 232 8230: 107, 233 8224: 108, 234 8225: 109, 235 8240: 110, 236 8249: 111, 237 168: 112, 238 711: 113, 239 184: 114, 240 8216: 115, 241 8217: 116, 242 8220: 117, 243 8221: 118, 244 8226: 119, 245 8211: 120, 246 8212: 121, 247 8482: 122, 248 8250: 123, 249 175: 124, 250 731: 125, 251 160: 126, 252 162: 127, 253 163: 128, 254 164: 129, 255 166: 130, 256 167: 131, 257 169: 132, 258 171: 133, 259 172: 134, 260 173: 135, 261 174: 136, 262 176: 137, 263 177: 138, 264 178: 139, 265 179: 140, 266 180: 141, 267 181: 142, 268 182: 143, 269 183: 144, 270 185: 145, 271 187: 146, 272 188: 147, 273 189: 148, 274 190: 149, 275 729: 150, 276 }