| 1 | /* -*- buffer-read-only: t -*- |
| 2 | * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! |
| 3 | * This file is built by regen/unicode_constants.pl from Unicode data. |
| 4 | * Any changes made here will be lost! |
| 5 | */ |
| 6 | |
| 7 | |
| 8 | #ifndef PERL_UNICODE_CONSTANTS_H_ /* Guard against nested #includes */ |
| 9 | #define PERL_UNICODE_CONSTANTS_H_ 1 |
| 10 | |
| 11 | /* This file contains #defines for the version of Unicode being used and |
| 12 | * various Unicode code points. The values the code point macros expand to |
| 13 | * are the native Unicode code point, or all or portions of the UTF-8 encoding |
| 14 | * for the code point. In the former case, the macro name has the suffix |
| 15 | * "_NATIVE"; otherwise, the suffix "_UTF8". |
| 16 | * |
| 17 | * The macros that have the suffix "_UTF8" may have further suffixes, as |
| 18 | * follows: |
| 19 | * "_FIRST_BYTE" if the value is just the first byte of the UTF-8 |
| 20 | * representation; the value will be a numeric constant. |
| 21 | * "_TAIL" if instead it represents all but the first byte. This, and |
| 22 | * with no additional suffix are both string constants */ |
| 23 | |
| 24 | /* |
| 25 | =for apidoc_section $unicode |
| 26 | |
| 27 | =for apidoc AmnU|const char *|BOM_UTF8 |
| 28 | |
| 29 | This is a macro that evaluates to a string constant of the UTF-8 bytes that |
| 30 | define the Unicode BYTE ORDER MARK (U+FEFF) for the platform that perl |
| 31 | is compiled on. This allows code to use a mnemonic for this character that |
| 32 | works on both ASCII and EBCDIC platforms. |
| 33 | S<C<sizeof(BOM_UTF8) - 1>> can be used to get its length in |
| 34 | bytes. |
| 35 | |
| 36 | =for apidoc AmnU|const char *|REPLACEMENT_CHARACTER_UTF8 |
| 37 | |
| 38 | This is a macro that evaluates to a string constant of the UTF-8 bytes that |
| 39 | define the Unicode REPLACEMENT CHARACTER (U+FFFD) for the platform that perl |
| 40 | is compiled on. This allows code to use a mnemonic for this character that |
| 41 | works on both ASCII and EBCDIC platforms. |
| 42 | S<C<sizeof(REPLACEMENT_CHARACTER_UTF8) - 1>> can be used to get its length in |
| 43 | bytes. |
| 44 | |
| 45 | =cut |
| 46 | */ |
| 47 | |
| 48 | #define UNICODE_MAJOR_VERSION 13 |
| 49 | #define UNICODE_DOT_VERSION 0 |
| 50 | #define UNICODE_DOT_DOT_VERSION 0 |
| 51 | |
| 52 | |
| 53 | #if 'A' == 65 /* ASCII/Latin1 */ |
| 54 | # define LATIN_SMALL_LETTER_LONG_S_UTF8 "\xC5\xBF" /* U+017F */ |
| 55 | |
| 56 | # define COMBINING_GRAVE_ACCENT_UTF8 "\xCC\x80" /* U+0300 */ |
| 57 | # define COMBINING_DOT_ABOVE_UTF8 "\xCC\x87" /* U+0307 */ |
| 58 | |
| 59 | # define LATIN_CAPITAL_LETTER_SHARP_S_UTF8 "\xE1\xBA\x9E" /* U+1E9E */ |
| 60 | |
| 61 | # define LATIN_SMALL_LIGATURE_LONG_S_T_UTF8 "\xEF\xAC\x85" /* U+FB05 */ |
| 62 | # define LATIN_SMALL_LIGATURE_ST_UTF8 "\xEF\xAC\x86" /* U+FB06 */ |
| 63 | # define LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_UTF8 "\xC4\xB0" /* U+0130 */ |
| 64 | # define LATIN_SMALL_LETTER_DOTLESS_I_UTF8 "\xC4\xB1" /* U+0131 */ |
| 65 | |
| 66 | # define HYPHEN_UTF8 "\xE2\x80\x90" /* U+2010 */ |
| 67 | # define BOM_UTF8_FIRST_BYTE 0xEF /* U+FEFF */ |
| 68 | # define BOM_UTF8_TAIL "\xBB\xBF" /* U+FEFF */ |
| 69 | |
| 70 | # define BOM_UTF8 "\xEF\xBB\xBF" /* U+FEFF */ |
| 71 | |
| 72 | # define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD" /* U+FFFD */ |
| 73 | |
| 74 | # define MAX_UNICODE_UTF8 "\xF4\x8F\xBF\xBF" /* U+10FFFF */ |
| 75 | |
| 76 | # define NBSP_NATIVE 0xA0 /* U+00A0 */ |
| 77 | # define NBSP_UTF8 "\xC2\xA0" /* U+00A0 */ |
| 78 | |
| 79 | # define DEL_NATIVE 0x7F /* U+007F */ |
| 80 | # define CR_NATIVE 0x0D /* U+000D */ |
| 81 | # define LF_NATIVE 0x0A /* U+000A */ |
| 82 | # define VT_NATIVE 0x0B /* U+000B */ |
| 83 | # define ESC_NATIVE 0x1B /* U+001B */ |
| 84 | # define LATIN_SMALL_LETTER_SHARP_S_NATIVE 0xDF /* U+00DF */ |
| 85 | # define LATIN_SMALL_LETTER_SHARP_S_UTF8 "\xC3\x9F" /* U+00DF */ |
| 86 | # define LATIN_SMALL_LETTER_A_WITH_RING_ABOVE_NATIVE 0xE5 /* U+00E5 */ |
| 87 | # define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0xC5 /* U+00C5 */ |
| 88 | # define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xFF /* U+00FF */ |
| 89 | # define MICRO_SIGN_NATIVE 0xB5 /* U+00B5 */ |
| 90 | # define MICRO_SIGN_UTF8 "\xC2\xB5" /* U+00B5 */ |
| 91 | |
| 92 | # ifdef PERL_IN_REGCOMP_C |
| 93 | # define MAX_PRINT_A 0x7E /* The max code point that isPRINT_A */ |
| 94 | # endif |
| 95 | #endif /* ASCII/Latin1 */ |
| 96 | |
| 97 | #if 'A' == 193 /* EBCDIC 1047 */ \ |
| 98 | && '\\' == 224 && '[' == 173 && ']' == 189 && '{' == 192 && '}' == 208 \ |
| 99 | && '^' == 95 && '~' == 161 && '!' == 90 && '#' == 123 && '|' == 79 \ |
| 100 | && '$' == 91 && '@' == 124 && '`' == 121 && '\n' == 21 |
| 101 | # define LATIN_SMALL_LETTER_LONG_S_UTF8 "\x8F\x73" /* U+017F */ |
| 102 | |
| 103 | # define COMBINING_GRAVE_ACCENT_UTF8 "\xAF\x41" /* U+0300 */ |
| 104 | # define COMBINING_DOT_ABOVE_UTF8 "\xAF\x48" /* U+0307 */ |
| 105 | |
| 106 | # define LATIN_CAPITAL_LETTER_SHARP_S_UTF8 "\xBF\x63\x72" /* U+1E9E */ |
| 107 | |
| 108 | # define LATIN_SMALL_LIGATURE_LONG_S_T_UTF8 "\xDD\x72\x67\x46" /* U+FB05 */ |
| 109 | # define LATIN_SMALL_LIGATURE_ST_UTF8 "\xDD\x72\x67\x47" /* U+FB06 */ |
| 110 | # define LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_UTF8 "\x8D\x57" /* U+0130 */ |
| 111 | # define LATIN_SMALL_LETTER_DOTLESS_I_UTF8 "\x8D\x58" /* U+0131 */ |
| 112 | |
| 113 | # define HYPHEN_UTF8 "\xCA\x41\x57" /* U+2010 */ |
| 114 | # define BOM_UTF8_FIRST_BYTE 0xDD /* U+FEFF */ |
| 115 | # define BOM_UTF8_TAIL "\x73\x66\x73" /* U+FEFF */ |
| 116 | |
| 117 | # define BOM_UTF8 "\xDD\x73\x66\x73" /* U+FEFF */ |
| 118 | |
| 119 | # define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71" /* U+FFFD */ |
| 120 | |
| 121 | # define MAX_UNICODE_UTF8 "\xEE\x42\x73\x73\x73" /* U+10FFFF */ |
| 122 | |
| 123 | # define NBSP_NATIVE 0x41 /* U+00A0 */ |
| 124 | # define NBSP_UTF8 "\x80\x41" /* U+00A0 */ |
| 125 | |
| 126 | # define DEL_NATIVE 0x07 /* U+007F */ |
| 127 | # define CR_NATIVE 0x0D /* U+000D */ |
| 128 | # define LF_NATIVE 0x15 /* U+000A */ |
| 129 | # define VT_NATIVE 0x0B /* U+000B */ |
| 130 | # define ESC_NATIVE 0x27 /* U+001B */ |
| 131 | # define LATIN_SMALL_LETTER_SHARP_S_NATIVE 0x59 /* U+00DF */ |
| 132 | # define LATIN_SMALL_LETTER_SHARP_S_UTF8 "\x8A\x73" /* U+00DF */ |
| 133 | # define LATIN_SMALL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x47 /* U+00E5 */ |
| 134 | # define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x67 /* U+00C5 */ |
| 135 | # define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xDF /* U+00FF */ |
| 136 | # define MICRO_SIGN_NATIVE 0xA0 /* U+00B5 */ |
| 137 | # define MICRO_SIGN_UTF8 "\x80\x64" /* U+00B5 */ |
| 138 | |
| 139 | # ifdef PERL_IN_REGCOMP_C |
| 140 | # define MAX_PRINT_A 0xF9 /* The max code point that isPRINT_A */ |
| 141 | # endif |
| 142 | #endif /* EBCDIC 1047 */ |
| 143 | |
| 144 | #if 'A' == 193 /* EBCDIC 037 */ \ |
| 145 | && '\\' == 224 && '[' == 186 && ']' == 187 && '{' == 192 && '}' == 208 \ |
| 146 | && '^' == 176 && '~' == 161 && '!' == 90 && '#' == 123 && '|' == 79 \ |
| 147 | && '$' == 91 && '@' == 124 && '`' == 121 && '\n' == 37 |
| 148 | # define LATIN_SMALL_LETTER_LONG_S_UTF8 "\x8E\x72" /* U+017F */ |
| 149 | |
| 150 | # define COMBINING_GRAVE_ACCENT_UTF8 "\xAD\x41" /* U+0300 */ |
| 151 | # define COMBINING_DOT_ABOVE_UTF8 "\xAD\x48" /* U+0307 */ |
| 152 | |
| 153 | # define LATIN_CAPITAL_LETTER_SHARP_S_UTF8 "\xBF\x62\x71" /* U+1E9E */ |
| 154 | |
| 155 | # define LATIN_SMALL_LIGATURE_LONG_S_T_UTF8 "\xDD\x71\x66\x46" /* U+FB05 */ |
| 156 | # define LATIN_SMALL_LIGATURE_ST_UTF8 "\xDD\x71\x66\x47" /* U+FB06 */ |
| 157 | # define LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_UTF8 "\x8C\x57" /* U+0130 */ |
| 158 | # define LATIN_SMALL_LETTER_DOTLESS_I_UTF8 "\x8C\x58" /* U+0131 */ |
| 159 | |
| 160 | # define HYPHEN_UTF8 "\xCA\x41\x57" /* U+2010 */ |
| 161 | # define BOM_UTF8_FIRST_BYTE 0xDD /* U+FEFF */ |
| 162 | # define BOM_UTF8_TAIL "\x72\x65\x72" /* U+FEFF */ |
| 163 | |
| 164 | # define BOM_UTF8 "\xDD\x72\x65\x72" /* U+FEFF */ |
| 165 | |
| 166 | # define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70" /* U+FFFD */ |
| 167 | |
| 168 | # define MAX_UNICODE_UTF8 "\xEE\x42\x72\x72\x72" /* U+10FFFF */ |
| 169 | |
| 170 | # define NBSP_NATIVE 0x41 /* U+00A0 */ |
| 171 | # define NBSP_UTF8 "\x78\x41" /* U+00A0 */ |
| 172 | |
| 173 | # define DEL_NATIVE 0x07 /* U+007F */ |
| 174 | # define CR_NATIVE 0x0D /* U+000D */ |
| 175 | # define LF_NATIVE 0x25 /* U+000A */ |
| 176 | # define VT_NATIVE 0x0B /* U+000B */ |
| 177 | # define ESC_NATIVE 0x27 /* U+001B */ |
| 178 | # define LATIN_SMALL_LETTER_SHARP_S_NATIVE 0x59 /* U+00DF */ |
| 179 | # define LATIN_SMALL_LETTER_SHARP_S_UTF8 "\x80\x72" /* U+00DF */ |
| 180 | # define LATIN_SMALL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x47 /* U+00E5 */ |
| 181 | # define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x67 /* U+00C5 */ |
| 182 | # define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xDF /* U+00FF */ |
| 183 | # define MICRO_SIGN_NATIVE 0xA0 /* U+00B5 */ |
| 184 | # define MICRO_SIGN_UTF8 "\x78\x63" /* U+00B5 */ |
| 185 | |
| 186 | # ifdef PERL_IN_REGCOMP_C |
| 187 | # define MAX_PRINT_A 0xF9 /* The max code point that isPRINT_A */ |
| 188 | # endif |
| 189 | #endif /* EBCDIC 037 */ |
| 190 | |
| 191 | /* The number of code points not matching \pC */ |
| 192 | #ifdef PERL_IN_REGCOMP_C |
| 193 | # define NON_OTHER_COUNT 143698 |
| 194 | #endif |
| 195 | |
| 196 | /* The highest code point that has any type of case change */ |
| 197 | #ifdef PERL_IN_UTF8_C |
| 198 | # define HIGHEST_CASE_CHANGING_CP 0x1E943 |
| 199 | #endif |
| 200 | |
| 201 | #endif /* PERL_UNICODE_CONSTANTS_H_ */ |
| 202 | |
| 203 | /* ex: set ro: */ |