github.com/dolthub/go-mysql-server@v0.18.0/sql/encodings/swe7.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  // Swe7 represents the `swe7` character set encoding.
    18  var Swe7 Encoder = &RangeMap{
    19  	inputEntries: [][]rangeMapEntry{
    20  		{
    21  			{
    22  				inputRange:  rangeBounds{{0, 63}},
    23  				outputRange: rangeBounds{{0, 63}},
    24  				inputMults:  []int{1},
    25  				outputMults: []int{1},
    26  			},
    27  			{
    28  				inputRange:  rangeBounds{{64, 64}},
    29  				outputRange: rangeBounds{{195, 195}, {137, 137}},
    30  				inputMults:  []int{1},
    31  				outputMults: []int{1, 1},
    32  			},
    33  			{
    34  				inputRange:  rangeBounds{{65, 90}},
    35  				outputRange: rangeBounds{{65, 90}},
    36  				inputMults:  []int{1},
    37  				outputMults: []int{1},
    38  			},
    39  			{
    40  				inputRange:  rangeBounds{{91, 91}},
    41  				outputRange: rangeBounds{{195, 195}, {132, 132}},
    42  				inputMults:  []int{1},
    43  				outputMults: []int{1, 1},
    44  			},
    45  			{
    46  				inputRange:  rangeBounds{{92, 92}},
    47  				outputRange: rangeBounds{{195, 195}, {150, 150}},
    48  				inputMults:  []int{1},
    49  				outputMults: []int{1, 1},
    50  			},
    51  			{
    52  				inputRange:  rangeBounds{{93, 93}},
    53  				outputRange: rangeBounds{{195, 195}, {133, 133}},
    54  				inputMults:  []int{1},
    55  				outputMults: []int{1, 1},
    56  			},
    57  			{
    58  				inputRange:  rangeBounds{{94, 94}},
    59  				outputRange: rangeBounds{{195, 195}, {156, 156}},
    60  				inputMults:  []int{1},
    61  				outputMults: []int{1, 1},
    62  			},
    63  			{
    64  				inputRange:  rangeBounds{{95, 95}},
    65  				outputRange: rangeBounds{{95, 95}},
    66  				inputMults:  []int{1},
    67  				outputMults: []int{1},
    68  			},
    69  			{
    70  				inputRange:  rangeBounds{{96, 96}},
    71  				outputRange: rangeBounds{{195, 195}, {169, 169}},
    72  				inputMults:  []int{1},
    73  				outputMults: []int{1, 1},
    74  			},
    75  			{
    76  				inputRange:  rangeBounds{{97, 122}},
    77  				outputRange: rangeBounds{{97, 122}},
    78  				inputMults:  []int{1},
    79  				outputMults: []int{1},
    80  			},
    81  			{
    82  				inputRange:  rangeBounds{{123, 123}},
    83  				outputRange: rangeBounds{{195, 195}, {164, 164}},
    84  				inputMults:  []int{1},
    85  				outputMults: []int{1, 1},
    86  			},
    87  			{
    88  				inputRange:  rangeBounds{{124, 124}},
    89  				outputRange: rangeBounds{{195, 195}, {182, 182}},
    90  				inputMults:  []int{1},
    91  				outputMults: []int{1, 1},
    92  			},
    93  			{
    94  				inputRange:  rangeBounds{{125, 125}},
    95  				outputRange: rangeBounds{{195, 195}, {165, 165}},
    96  				inputMults:  []int{1},
    97  				outputMults: []int{1, 1},
    98  			},
    99  			{
   100  				inputRange:  rangeBounds{{126, 126}},
   101  				outputRange: rangeBounds{{195, 195}, {188, 188}},
   102  				inputMults:  []int{1},
   103  				outputMults: []int{1, 1},
   104  			},
   105  		},
   106  		nil,
   107  		nil,
   108  		nil,
   109  	},
   110  	outputEntries: [][]rangeMapEntry{
   111  		{
   112  			{
   113  				inputRange:  rangeBounds{{0, 63}},
   114  				outputRange: rangeBounds{{0, 63}},
   115  				inputMults:  []int{1},
   116  				outputMults: []int{1},
   117  			},
   118  			{
   119  				inputRange:  rangeBounds{{65, 90}},
   120  				outputRange: rangeBounds{{65, 90}},
   121  				inputMults:  []int{1},
   122  				outputMults: []int{1},
   123  			},
   124  			{
   125  				inputRange:  rangeBounds{{95, 95}},
   126  				outputRange: rangeBounds{{95, 95}},
   127  				inputMults:  []int{1},
   128  				outputMults: []int{1},
   129  			},
   130  			{
   131  				inputRange:  rangeBounds{{97, 122}},
   132  				outputRange: rangeBounds{{97, 122}},
   133  				inputMults:  []int{1},
   134  				outputMults: []int{1},
   135  			},
   136  		},
   137  		{
   138  			{
   139  				inputRange:  rangeBounds{{64, 64}},
   140  				outputRange: rangeBounds{{195, 195}, {137, 137}},
   141  				inputMults:  []int{1},
   142  				outputMults: []int{1, 1},
   143  			},
   144  			{
   145  				inputRange:  rangeBounds{{91, 91}},
   146  				outputRange: rangeBounds{{195, 195}, {132, 132}},
   147  				inputMults:  []int{1},
   148  				outputMults: []int{1, 1},
   149  			},
   150  			{
   151  				inputRange:  rangeBounds{{92, 92}},
   152  				outputRange: rangeBounds{{195, 195}, {150, 150}},
   153  				inputMults:  []int{1},
   154  				outputMults: []int{1, 1},
   155  			},
   156  			{
   157  				inputRange:  rangeBounds{{93, 93}},
   158  				outputRange: rangeBounds{{195, 195}, {133, 133}},
   159  				inputMults:  []int{1},
   160  				outputMults: []int{1, 1},
   161  			},
   162  			{
   163  				inputRange:  rangeBounds{{94, 94}},
   164  				outputRange: rangeBounds{{195, 195}, {156, 156}},
   165  				inputMults:  []int{1},
   166  				outputMults: []int{1, 1},
   167  			},
   168  			{
   169  				inputRange:  rangeBounds{{96, 96}},
   170  				outputRange: rangeBounds{{195, 195}, {169, 169}},
   171  				inputMults:  []int{1},
   172  				outputMults: []int{1, 1},
   173  			},
   174  			{
   175  				inputRange:  rangeBounds{{123, 123}},
   176  				outputRange: rangeBounds{{195, 195}, {164, 164}},
   177  				inputMults:  []int{1},
   178  				outputMults: []int{1, 1},
   179  			},
   180  			{
   181  				inputRange:  rangeBounds{{124, 124}},
   182  				outputRange: rangeBounds{{195, 195}, {182, 182}},
   183  				inputMults:  []int{1},
   184  				outputMults: []int{1, 1},
   185  			},
   186  			{
   187  				inputRange:  rangeBounds{{125, 125}},
   188  				outputRange: rangeBounds{{195, 195}, {165, 165}},
   189  				inputMults:  []int{1},
   190  				outputMults: []int{1, 1},
   191  			},
   192  			{
   193  				inputRange:  rangeBounds{{126, 126}},
   194  				outputRange: rangeBounds{{195, 195}, {188, 188}},
   195  				inputMults:  []int{1},
   196  				outputMults: []int{1, 1},
   197  			},
   198  		},
   199  		nil,
   200  		nil,
   201  	},
   202  	toUpper: map[rune]rune{
   203  		97:  65,
   204  		98:  66,
   205  		99:  67,
   206  		100: 68,
   207  		101: 69,
   208  		102: 70,
   209  		103: 71,
   210  		104: 72,
   211  		105: 73,
   212  		106: 74,
   213  		107: 75,
   214  		108: 76,
   215  		109: 77,
   216  		110: 78,
   217  		111: 79,
   218  		112: 80,
   219  		113: 81,
   220  		114: 82,
   221  		115: 83,
   222  		116: 84,
   223  		117: 85,
   224  		118: 86,
   225  		119: 87,
   226  		120: 88,
   227  		121: 89,
   228  		122: 90,
   229  		228: 196,
   230  		229: 197,
   231  		233: 201,
   232  		246: 214,
   233  		252: 220,
   234  	},
   235  	toLower: map[rune]rune{
   236  		65:  97,
   237  		66:  98,
   238  		67:  99,
   239  		68:  100,
   240  		69:  101,
   241  		70:  102,
   242  		71:  103,
   243  		72:  104,
   244  		73:  105,
   245  		74:  106,
   246  		75:  107,
   247  		76:  108,
   248  		77:  109,
   249  		78:  110,
   250  		79:  111,
   251  		80:  112,
   252  		81:  113,
   253  		82:  114,
   254  		83:  115,
   255  		84:  116,
   256  		85:  117,
   257  		86:  118,
   258  		87:  119,
   259  		88:  120,
   260  		89:  121,
   261  		90:  122,
   262  		196: 228,
   263  		197: 229,
   264  		201: 233,
   265  		214: 246,
   266  		220: 252,
   267  	},
   268  }