github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/cp1256_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 // Cp1256_general_ci_RuneWeight returns the weight of a given rune based on its relational sort order from 18 // the `cp1256_general_ci` collation. 19 func Cp1256_general_ci_RuneWeight(r rune) int32 { 20 weight, ok := cp1256_general_ci_Weights[r] 21 if ok { 22 return weight 23 } else { 24 return 2147483647 25 } 26 } 27 28 // cp1256_general_ci_Weights contain a map from rune to weight for the `cp1256_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 cp1256_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 224: 66, 100 226: 67, 101 66: 68, 102 98: 68, 103 67: 69, 104 99: 69, 105 231: 70, 106 68: 71, 107 100: 71, 108 69: 72, 109 101: 72, 110 232: 73, 111 233: 74, 112 234: 75, 113 235: 76, 114 70: 77, 115 102: 77, 116 402: 78, 117 71: 79, 118 103: 79, 119 72: 80, 120 104: 80, 121 73: 81, 122 105: 81, 123 238: 82, 124 239: 83, 125 74: 84, 126 106: 84, 127 75: 85, 128 107: 85, 129 76: 86, 130 108: 86, 131 77: 87, 132 109: 87, 133 78: 88, 134 110: 88, 135 79: 89, 136 111: 89, 137 244: 90, 138 338: 91, 139 339: 91, 140 80: 92, 141 112: 92, 142 81: 93, 143 113: 93, 144 82: 94, 145 114: 94, 146 83: 95, 147 115: 95, 148 84: 96, 149 116: 96, 150 85: 97, 151 117: 97, 152 249: 98, 153 251: 99, 154 252: 100, 155 86: 101, 156 118: 101, 157 87: 102, 158 119: 102, 159 88: 103, 160 120: 103, 161 89: 104, 162 121: 104, 163 90: 105, 164 122: 105, 165 1569: 106, 166 1570: 107, 167 1571: 108, 168 1572: 109, 169 1573: 110, 170 1574: 111, 171 1575: 112, 172 1576: 113, 173 1577: 114, 174 1662: 115, 175 1579: 116, 176 1580: 117, 177 1670: 118, 178 1581: 119, 179 1582: 120, 180 1583: 121, 181 1584: 122, 182 1585: 123, 183 1586: 124, 184 1688: 125, 185 1587: 126, 186 1588: 127, 187 1589: 128, 188 1590: 129, 189 1591: 130, 190 1578: 131, 191 1592: 131, 192 1593: 132, 193 1594: 133, 194 1601: 134, 195 1602: 135, 196 1603: 136, 197 1711: 137, 198 1604: 138, 199 1605: 139, 200 1606: 140, 201 1607: 141, 202 1608: 142, 203 1609: 143, 204 1610: 144, 205 1600: 145, 206 1611: 146, 207 1612: 147, 208 1613: 148, 209 1614: 149, 210 1615: 150, 211 1616: 151, 212 1617: 152, 213 1618: 153, 214 1548: 154, 215 1563: 155, 216 1567: 156, 217 91: 157, 218 92: 158, 219 93: 159, 220 94: 160, 221 95: 161, 222 96: 162, 223 123: 163, 224 124: 164, 225 125: 165, 226 126: 166, 227 127: 167, 228 8364: 168, 229 8218: 169, 230 8222: 170, 231 8230: 171, 232 8224: 172, 233 8225: 173, 234 710: 174, 235 8240: 175, 236 8249: 176, 237 8216: 177, 238 8217: 178, 239 8220: 179, 240 8221: 180, 241 8226: 181, 242 8211: 182, 243 8212: 183, 244 8482: 184, 245 8250: 185, 246 8204: 186, 247 8205: 187, 248 160: 188, 249 162: 189, 250 163: 190, 251 164: 191, 252 165: 192, 253 166: 193, 254 167: 194, 255 168: 195, 256 169: 196, 257 171: 197, 258 172: 198, 259 173: 199, 260 174: 200, 261 175: 201, 262 176: 202, 263 177: 203, 264 178: 204, 265 179: 205, 266 180: 206, 267 181: 207, 268 182: 208, 269 183: 209, 270 184: 210, 271 185: 211, 272 187: 212, 273 188: 213, 274 189: 214, 275 190: 215, 276 215: 216, 277 247: 217, 278 8206: 218, 279 8207: 219, 280 }