| 1 |
/* |
| 2 |
* Copyright (C) 2009-2017 TeraTerm Project |
| 3 |
* All rights reserved. |
| 4 |
* |
| 5 |
* Redistribution and use in source and binary forms, with or without |
| 6 |
* modification, are permitted provided that the following conditions |
| 7 |
* are met: |
| 8 |
* |
| 9 |
* 1. Redistributions of source code must retain the above copyright |
| 10 |
* notice, this list of conditions and the following disclaimer. |
| 11 |
* 2. Redistributions in binary form must reproduce the above copyright |
| 12 |
* notice, this list of conditions and the following disclaimer in the |
| 13 |
* documentation and/or other materials provided with the distribution. |
| 14 |
* 3. The name of the author may not be used to endorse or promote products |
| 15 |
* derived from this software without specific prior written permission. |
| 16 |
* |
| 17 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR |
| 18 |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 19 |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 20 |
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 |
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 22 |
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 |
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 |
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 |
*/ |
| 28 |
#include "codemap.h" |
| 29 |
|
| 30 |
/* |
| 31 |
* Map of Unicode Symbols to Dec Special Characters |
| 32 |
*/ |
| 33 |
static const codemap_t mapUnicodeSymbolToDecSp[] = { |
| 34 |
#if 0 |
| 35 |
{ 0x00b0, 0x0266 }, // DEGREE SIGN |
| 36 |
{ 0x00b1, 0x0267 }, // PLUS-MINUS SIGN |
| 37 |
#endif |
| 38 |
|
| 39 |
/* |
| 40 |
* Latin-1 supplement |
| 41 |
* http://www.unicode.org/charts/PDF/U0080.pdf |
| 42 |
*/ |
| 43 |
{ 0x00B7, 0x047E }, // Middle dot |
| 44 |
#if 0 |
| 45 |
{ 0x03c0, 0x047b }, // GREEK SMALL LETTER PI |
| 46 |
#endif |
| 47 |
|
| 48 |
/* |
| 49 |
* General punctuation |
| 50 |
* http://www.unicode.org/charts/PDF/U2000.pdf |
| 51 |
*/ |
| 52 |
{ 0x2022, 0x027E }, // Bullet |
| 53 |
{ 0x2024, 0x047E }, // One dot leader |
| 54 |
{ 0x2027, 0x027E }, // Hyphenation point |
| 55 |
|
| 56 |
/* |
| 57 |
* Mathematical operators |
| 58 |
* http://www.unicode.org/charts/PDF/U2200.pdf |
| 59 |
*/ |
| 60 |
{ 0x2219, 0x047E }, // Bullet operator |
| 61 |
#if 0 |
| 62 |
{ 0x2260, 0x047c }, // NOT EQUAL TO |
| 63 |
{ 0x2264, 0x0479 }, // LESS-THAN OR EQUAL TO |
| 64 |
{ 0x2265, 0x047a }, // GREATER-THAN OR EQUAL TO |
| 65 |
#endif |
| 66 |
|
| 67 |
/* |
| 68 |
* Horizontal Scan line |
| 69 |
*/ |
| 70 |
{ 0x23BA, 0x016f }, // HORIZONTAL SCAN LINE-1 |
| 71 |
{ 0x23BB, 0x0170 }, // HORIZONTAL SCAN LINE-3 |
| 72 |
// SCAN LINE-5 is unified with the box-drawing graphic character U+2500 |
| 73 |
{ 0x23BC, 0x0172 }, // HORIZONTAL SCAN LINE-7 |
| 74 |
{ 0x23BD, 0x0173 }, // HORIZONTAL SCAN LINE-9 |
| 75 |
|
| 76 |
/* |
| 77 |
* Box drawing |
| 78 |
* http://www.unicode.org/charts/PDF/U2500.pdf |
| 79 |
*/ |
| 80 |
{ 0x2500, 0x0171 }, // Box drawings light horizontal |
| 81 |
{ 0x2501, 0x0171 }, // Box drawings heavy horizontal |
| 82 |
{ 0x2502, 0x0178 }, // Box drawings light vertical |
| 83 |
{ 0x2503, 0x0178 }, // Box drawings heavy vertical |
| 84 |
{ 0x2504, 0x0171 }, // Box drawings light triple dash horizontal |
| 85 |
{ 0x2505, 0x0171 }, // Box drawings heavy triple dash horizontal |
| 86 |
{ 0x2506, 0x0178 }, // Box drawings light triple dash vertical |
| 87 |
{ 0x2507, 0x0178 }, // Box drawings heavy triple dash vertical |
| 88 |
{ 0x2508, 0x0171 }, // Box drawings light quadruple dash horizontal |
| 89 |
{ 0x2509, 0x0171 }, // Box drawings heavy quadruple dash horizontal |
| 90 |
{ 0x250A, 0x0178 }, // Box drawings light quadruple dash vertical |
| 91 |
{ 0x250B, 0x0178 }, // Box drawings heavy quadruple dash vertical |
| 92 |
{ 0x250C, 0x016C }, // Box drawings light down and right |
| 93 |
{ 0x250D, 0x016C }, // Box drawings down light and right heavy |
| 94 |
{ 0x250E, 0x016C }, // Box drawings down heavy and right light |
| 95 |
{ 0x250F, 0x016C }, // Box drawings heavy down and right |
| 96 |
{ 0x2510, 0x016B }, // Box drawings light down and left |
| 97 |
{ 0x2511, 0x016B }, // Box drawings down light and left heavy |
| 98 |
{ 0x2512, 0x016B }, // Box drawings down heavy and left light |
| 99 |
{ 0x2513, 0x016B }, // Box drawings heavy down and left |
| 100 |
{ 0x2514, 0x016D }, // Box drawings light up and right |
| 101 |
{ 0x2515, 0x016D }, // Box drawings up light and right heavy |
| 102 |
{ 0x2516, 0x016D }, // Box drawings up heavy and right light |
| 103 |
{ 0x2517, 0x016D }, // Box drawings heavy up and right |
| 104 |
{ 0x2518, 0x016A }, // Box drawings light up and left |
| 105 |
{ 0x2519, 0x016A }, // Box drawings up light and left heavy |
| 106 |
{ 0x251A, 0x016A }, // Box drawings up heavy and left light |
| 107 |
{ 0x251B, 0x016A }, // Box drawings heavy up and left |
| 108 |
{ 0x251C, 0x0174 }, // Box drawings light vertical and right |
| 109 |
{ 0x251D, 0x0174 }, // Box drawings vertical light and right heavy |
| 110 |
{ 0x251E, 0x0174 }, // Box drawings up heavy and right down light |
| 111 |
{ 0x251F, 0x0174 }, // Box drawings down heavy and right up light |
| 112 |
{ 0x2520, 0x0174 }, // Box drawings vertical heavy and right light |
| 113 |
{ 0x2521, 0x0174 }, // Box drawings down light and right up heavy |
| 114 |
{ 0x2522, 0x0174 }, // Box drawings up light and right down heavy |
| 115 |
{ 0x2523, 0x0174 }, // Box drawings heavy vertical and right |
| 116 |
{ 0x2524, 0x0175 }, // Box drawings light vertical and left |
| 117 |
{ 0x2525, 0x0175 }, // Box drawings vertical light and left heavy |
| 118 |
{ 0x2526, 0x0175 }, // Box drawings up heavy and left down light |
| 119 |
{ 0x2527, 0x0175 }, // Box drawings down heavy and left up light |
| 120 |
{ 0x2528, 0x0175 }, // Box drawings vertical heavy and left light |
| 121 |
{ 0x2529, 0x0175 }, // Box drawings down light and left up heavy |
| 122 |
{ 0x252A, 0x0175 }, // Box drawings up light and left down heavy |
| 123 |
{ 0x252B, 0x0175 }, // Box drawings heavy vertical and left |
| 124 |
{ 0x252C, 0x0177 }, // Box drawings light down and horizontal |
| 125 |
{ 0x252D, 0x0177 }, // Box drawings left heavy and right down light |
| 126 |
{ 0x252E, 0x0177 }, // Box drawings right heavy and left down light |
| 127 |
{ 0x252F, 0x0177 }, // Box drawings down light and horizontal heavy |
| 128 |
{ 0x2530, 0x0177 }, // Box drawings down heavy and horizontal light |
| 129 |
{ 0x2531, 0x0177 }, // Box drawings right light and left down heavy |
| 130 |
{ 0x2532, 0x0177 }, // Box drawings left light and right down heavy |
| 131 |
{ 0x2533, 0x0177 }, // Box drawings heavy down and horizontal |
| 132 |
{ 0x2534, 0x0176 }, // Box drawings light up and horizontal |
| 133 |
{ 0x2535, 0x0176 }, // Box drawings left heavy and right up light |
| 134 |
{ 0x2536, 0x0176 }, // Box drawings right heavy and left up light |
| 135 |
{ 0x2537, 0x0176 }, // Box drawings up light and horizontal heavy |
| 136 |
{ 0x2538, 0x0176 }, // Box drawings up heavy and horizontal light |
| 137 |
{ 0x2539, 0x0176 }, // Box drawings right light and left up heavy |
| 138 |
{ 0x253A, 0x0176 }, // Box drawings left light and right up heavy |
| 139 |
{ 0x253B, 0x0176 }, // Box drawings right up and horizontal |
| 140 |
{ 0x253C, 0x016e }, // Box drawings light vertical and horizontal |
| 141 |
{ 0x253D, 0x016e }, // Box drawings left heavy and right vertical light |
| 142 |
{ 0x253E, 0x016e }, // Box drawings right heavy and left vertical light |
| 143 |
{ 0x253F, 0x016e }, // Box drawings vertical light and horizontal heavy |
| 144 |
{ 0x2540, 0x016e }, // Box drawings up heavy and down horizontal light |
| 145 |
{ 0x2541, 0x016e }, // Box drawings down heavy and up horizontal light |
| 146 |
{ 0x2542, 0x016e }, // Box drawings vertical heavy and horizontal light |
| 147 |
{ 0x2543, 0x016e }, // Box drawings left up heavy and right down light |
| 148 |
{ 0x2544, 0x016e }, // Box drawings right up heavy and left down light |
| 149 |
{ 0x2545, 0x016e }, // Box drawings left down heavy and right up light |
| 150 |
{ 0x2546, 0x016e }, // Box drawings right down heavy and left up light |
| 151 |
{ 0x2547, 0x016e }, // Box drawings down light and up horizontal heavy |
| 152 |
{ 0x2548, 0x016e }, // Box drawings up light and up horizontal heavy |
| 153 |
{ 0x2549, 0x016e }, // Box drawings right light and left vertical heavy |
| 154 |
{ 0x254A, 0x016e }, // Box drawings left light and right vertical heavy |
| 155 |
{ 0x254B, 0x016e }, // Box drawings heavy vertical and horizontal |
| 156 |
{ 0x254C, 0x0171 }, // Box drawings light double dash horizontal |
| 157 |
{ 0x254D, 0x0171 }, // Box drawings heavy double dash horizontal |
| 158 |
{ 0x254E, 0x0178 }, // Box drawings light double dash vertical |
| 159 |
{ 0x254F, 0x0178 }, // Box drawings heavy double dash vertical |
| 160 |
{ 0x2550, 0x0171 }, // Box drawings double horizontal |
| 161 |
{ 0x2551, 0x0178 }, // Box drawings double vertical |
| 162 |
{ 0x2552, 0x016C }, // Box drawings down single and right double |
| 163 |
{ 0x2553, 0x016C }, // Box drawings down double and right single |
| 164 |
{ 0x2554, 0x016C }, // Box drawings double down and right |
| 165 |
{ 0x2555, 0x016B }, // Box drawings down single and left double |
| 166 |
{ 0x2556, 0x016B }, // Box drawings down double and left single |
| 167 |
{ 0x2557, 0x016B }, // Box drawings double down and left |
| 168 |
{ 0x2558, 0x016D }, // Box drawings up single and right double |
| 169 |
{ 0x2559, 0x016D }, // Box drawings up double and right single |
| 170 |
{ 0x255A, 0x016D }, // Box drawings double up and right |
| 171 |
{ 0x255B, 0x016A }, // Box drawings up single and left double |
| 172 |
{ 0x255C, 0x016A }, // Box drawings up double and left single |
| 173 |
{ 0x255D, 0x016A }, // Box drawings double up and left |
| 174 |
{ 0x255E, 0x0174 }, // Box drawings vertical single and right double |
| 175 |
{ 0x255F, 0x0174 }, // Box drawings vertical double and right single |
| 176 |
{ 0x2560, 0x0174 }, // Box drawings double vertical and right |
| 177 |
{ 0x2561, 0x0175 }, // Box drawings vertical single and left double |
| 178 |
{ 0x2562, 0x0175 }, // Box drawings vertical double and left single |
| 179 |
{ 0x2563, 0x0175 }, // Box drawings double vertical and left |
| 180 |
{ 0x2564, 0x0177 }, // Box drawings down single and horizontal double |
| 181 |
{ 0x2565, 0x0177 }, // Box drawings down double and horizontal single |
| 182 |
{ 0x2566, 0x0177 }, // Box drawings double down and horizontal |
| 183 |
{ 0x2567, 0x0176 }, // Box drawings up single and horizontal double |
| 184 |
{ 0x2568, 0x0176 }, // Box drawings up double and horizontal single |
| 185 |
{ 0x2569, 0x0176 }, // Box drawings double up and horizontal |
| 186 |
{ 0x256A, 0x016E }, // Box drawings double vertical single and horizontal double |
| 187 |
{ 0x256B, 0x016E }, // Box drawings double vertical double and horizontal single |
| 188 |
{ 0x256C, 0x016E }, // Box drawings double vertical and horizontal |
| 189 |
{ 0x256D, 0x016C }, // Box drawings light arc down and right |
| 190 |
{ 0x256E, 0x016B }, // Box drawings light arc down and left |
| 191 |
{ 0x256F, 0x016A }, // Box drawings light arc up and left |
| 192 |
{ 0x2570, 0x016D }, // Box drawings light arc left and right |
| 193 |
/* |
| 194 |
{ 0x2571, 0x0000 }, // Box drawings light diagonal upper right to lower left |
| 195 |
{ 0x2572, 0x0000 }, // Box drawings light diagonal upper left to lower right |
| 196 |
{ 0x2573, 0x0000 }, // Box drawings light diagonal cross |
| 197 |
{ 0x2574, 0x0000 }, // Box drawings light left |
| 198 |
{ 0x2575, 0x0000 }, // Box drawings light up |
| 199 |
{ 0x2576, 0x0000 }, // Box drawings light right |
| 200 |
{ 0x2577, 0x0000 }, // Box drawings light down |
| 201 |
{ 0x2578, 0x0000 }, // Box drawings heavy left |
| 202 |
{ 0x2579, 0x0000 }, // Box drawings heavy up |
| 203 |
{ 0x257A, 0x0000 }, // Box drawings heavy right |
| 204 |
{ 0x257B, 0x0000 }, // Box drawings heavy down |
| 205 |
*/ |
| 206 |
{ 0x257C, 0x0171 }, // Box drawings light left and heavy right |
| 207 |
{ 0x257D, 0x0178 }, // Box drawings light up and heavy down |
| 208 |
{ 0x257E, 0x0171 }, // Box drawings heavy left and light right |
| 209 |
{ 0x257F, 0x0178 }, // Box drawings heavy up and light down |
| 210 |
|
| 211 |
/* |
| 212 |
* Block Elements and Shade Characters |
| 213 |
* http://www.unicode.org/charts/PDF/U2580.pdf |
| 214 |
*/ |
| 215 |
// { 0x2588, 0x0460 }, // Full block |
| 216 |
{ 0x2591, 0x0261 }, // Light shade (25%) |
| 217 |
{ 0x2592, 0x0261 }, // Medium shade (50%) |
| 218 |
{ 0x2593, 0x0261 }, // Dark shade (75%) |
| 219 |
|
| 220 |
/* |
| 221 |
* Geometric Shapes |
| 222 |
* http://www.unicode.org/charts/PDF/U25A0.pdf |
| 223 |
*/ |
| 224 |
{ 0x25AA, 0x027E }, // Black small square |
| 225 |
{ 0x25AE, 0x0260 }, // Black vertical rectangle |
| 226 |
#if 0 |
| 227 |
{ 0x25c6, 0x0260 }, // BLACK DIAMOND |
| 228 |
#endif |
| 229 |
|
| 230 |
/* |
| 231 |
* Miscellaneous symbols and arrows |
| 232 |
* http://www.unicode.org/charts/PDF/U2B00.pdf |
| 233 |
*/ |
| 234 |
{ 0x2B1D, 0x027E }, // Black very small square |
| 235 |
}; |