This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
regcharclass.h: Simplify some expressions
[perl5.git] / unicode_constants.h
CommitLineData
61dad979
KW
1/* -*- buffer-read-only: t -*-
2 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
1b0f46bf 3 * This file is built by regen/unicode_constants.pl from Unicode data.
61dad979
KW
4 * Any changes made here will be lost!
5 */
6
d10c72f2 7
6a5bc5ac
KW
8#ifndef PERL_UNICODE_CONSTANTS_H_ /* Guard against nested #includes */
9#define PERL_UNICODE_CONSTANTS_H_ 1
d10c72f2 10
4b4853d1
KW
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".
61dad979 16 *
525b6419
KW
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 */
61dad979 23
69bc4c1f 24/*
3f620621 25=for apidoc_section $unicode
69bc4c1f 26
78342678 27=for apidoc AmnU|const char *|BOM_UTF8
69bc4c1f
KW
28
29This is a macro that evaluates to a string constant of the UTF-8 bytes that
30define the Unicode BYTE ORDER MARK (U+FEFF) for the platform that perl
31is compiled on. This allows code to use a mnemonic for this character that
32works on both ASCII and EBCDIC platforms.
33S<C<sizeof(BOM_UTF8) - 1>> can be used to get its length in
34bytes.
35
78342678 36=for apidoc AmnU|const char *|REPLACEMENT_CHARACTER_UTF8
69bc4c1f
KW
37
38This is a macro that evaluates to a string constant of the UTF-8 bytes that
39define the Unicode REPLACEMENT CHARACTER (U+FFFD) for the platform that perl
40is compiled on. This allows code to use a mnemonic for this character that
41works on both ASCII and EBCDIC platforms.
42S<C<sizeof(REPLACEMENT_CHARACTER_UTF8) - 1>> can be used to get its length in
43bytes.
44
45=cut
46*/
47
b6dbf1d3
UC
48#define UNICODE_MAJOR_VERSION 13
49#define UNICODE_DOT_VERSION 0
4b4853d1
KW
50#define UNICODE_DOT_DOT_VERSION 0
51
76837d21 52
ad88cddb
KW
53#if 'A' == 65 /* ASCII/Latin1 */
54# define LATIN_SMALL_LETTER_LONG_S_UTF8 "\xC5\xBF" /* U+017F */
76837d21 55
ad88cddb 56# define COMBINING_GRAVE_ACCENT_UTF8 "\xCC\x80" /* U+0300 */
2a614cdc 57# define COMBINING_DOT_ABOVE_UTF8 "\xCC\x87" /* U+0307 */
f2e06375 58
ad88cddb 59# define LATIN_CAPITAL_LETTER_SHARP_S_UTF8 "\xE1\xBA\x9E" /* U+1E9E */
a9f50d33 60
ad88cddb
KW
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 */
a0ffb25e
KW
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 */
1dfa4f52 65
ad88cddb 66# define HYPHEN_UTF8 "\xE2\x80\x90" /* U+2010 */
ad88cddb
KW
67# define BOM_UTF8_FIRST_BYTE 0xEF /* U+FEFF */
68# define BOM_UTF8_TAIL "\xBB\xBF" /* U+FEFF */
df758df2 69
69bc4c1f
KW
70# define BOM_UTF8 "\xEF\xBB\xBF" /* U+FEFF */
71
72# define REPLACEMENT_CHARACTER_UTF8 "\xEF\xBF\xBD" /* U+FFFD */
73
566efd88
KW
74# define MAX_UNICODE_UTF8 "\xF4\x8F\xBF\xBF" /* U+10FFFF */
75
ad88cddb
KW
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 */
d804860b
KW
82# define VT_NATIVE 0x0B /* U+000B */
83# define ESC_NATIVE 0x1B /* U+001B */
ad88cddb 84# define LATIN_SMALL_LETTER_SHARP_S_NATIVE 0xDF /* U+00DF */
69ffc8e3 85# define LATIN_SMALL_LETTER_SHARP_S_UTF8 "\xC3\x9F" /* U+00DF */
ad88cddb
KW
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 */
69ffc8e3 90# define MICRO_SIGN_UTF8 "\xC2\xB5" /* U+00B5 */
09cc440d 91# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0x7E /* The max code point that isPRINT_A */
ad88cddb
KW
92
93#endif /* ASCII/Latin1 */
94
95#if 'A' == 193 /* EBCDIC 1047 */ \
96 && '\\' == 224 && '[' == 173 && ']' == 189 && '{' == 192 && '}' == 208 \
97 && '^' == 95 && '~' == 161 && '!' == 90 && '#' == 123 && '|' == 79 \
c11f6329 98 && '$' == 91 && '@' == 124 && '`' == 121 && '\n' == 21
ad88cddb
KW
99# define LATIN_SMALL_LETTER_LONG_S_UTF8 "\x8F\x73" /* U+017F */
100
101# define COMBINING_GRAVE_ACCENT_UTF8 "\xAF\x41" /* U+0300 */
2a614cdc 102# define COMBINING_DOT_ABOVE_UTF8 "\xAF\x48" /* U+0307 */
ad88cddb
KW
103
104# define LATIN_CAPITAL_LETTER_SHARP_S_UTF8 "\xBF\x63\x72" /* U+1E9E */
105
106# define LATIN_SMALL_LIGATURE_LONG_S_T_UTF8 "\xDD\x72\x67\x46" /* U+FB05 */
107# define LATIN_SMALL_LIGATURE_ST_UTF8 "\xDD\x72\x67\x47" /* U+FB06 */
a0ffb25e
KW
108# define LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_UTF8 "\x8D\x57" /* U+0130 */
109# define LATIN_SMALL_LETTER_DOTLESS_I_UTF8 "\x8D\x58" /* U+0131 */
ad88cddb
KW
110
111# define HYPHEN_UTF8 "\xCA\x41\x57" /* U+2010 */
ad88cddb
KW
112# define BOM_UTF8_FIRST_BYTE 0xDD /* U+FEFF */
113# define BOM_UTF8_TAIL "\x73\x66\x73" /* U+FEFF */
114
69bc4c1f
KW
115# define BOM_UTF8 "\xDD\x73\x66\x73" /* U+FEFF */
116
117# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x73\x73\x71" /* U+FFFD */
118
566efd88
KW
119# define MAX_UNICODE_UTF8 "\xEE\x42\x73\x73\x73" /* U+10FFFF */
120
ad88cddb
KW
121# define NBSP_NATIVE 0x41 /* U+00A0 */
122# define NBSP_UTF8 "\x80\x41" /* U+00A0 */
123
124# define DEL_NATIVE 0x07 /* U+007F */
125# define CR_NATIVE 0x0D /* U+000D */
126# define LF_NATIVE 0x15 /* U+000A */
d804860b
KW
127# define VT_NATIVE 0x0B /* U+000B */
128# define ESC_NATIVE 0x27 /* U+001B */
ad88cddb 129# define LATIN_SMALL_LETTER_SHARP_S_NATIVE 0x59 /* U+00DF */
69ffc8e3 130# define LATIN_SMALL_LETTER_SHARP_S_UTF8 "\x8A\x73" /* U+00DF */
ad88cddb
KW
131# define LATIN_SMALL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x47 /* U+00E5 */
132# define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x67 /* U+00C5 */
133# define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xDF /* U+00FF */
134# define MICRO_SIGN_NATIVE 0xA0 /* U+00B5 */
69ffc8e3 135# define MICRO_SIGN_UTF8 "\x80\x64" /* U+00B5 */
09cc440d 136# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0xF9 /* The max code point that isPRINT_A */
ad88cddb
KW
137
138#endif /* EBCDIC 1047 */
139
140#if 'A' == 193 /* EBCDIC 037 */ \
141 && '\\' == 224 && '[' == 186 && ']' == 187 && '{' == 192 && '}' == 208 \
142 && '^' == 176 && '~' == 161 && '!' == 90 && '#' == 123 && '|' == 79 \
c11f6329 143 && '$' == 91 && '@' == 124 && '`' == 121 && '\n' == 37
ad88cddb
KW
144# define LATIN_SMALL_LETTER_LONG_S_UTF8 "\x8E\x72" /* U+017F */
145
146# define COMBINING_GRAVE_ACCENT_UTF8 "\xAD\x41" /* U+0300 */
2a614cdc 147# define COMBINING_DOT_ABOVE_UTF8 "\xAD\x48" /* U+0307 */
ad88cddb
KW
148
149# define LATIN_CAPITAL_LETTER_SHARP_S_UTF8 "\xBF\x62\x71" /* U+1E9E */
150
151# define LATIN_SMALL_LIGATURE_LONG_S_T_UTF8 "\xDD\x71\x66\x46" /* U+FB05 */
152# define LATIN_SMALL_LIGATURE_ST_UTF8 "\xDD\x71\x66\x47" /* U+FB06 */
a0ffb25e
KW
153# define LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE_UTF8 "\x8C\x57" /* U+0130 */
154# define LATIN_SMALL_LETTER_DOTLESS_I_UTF8 "\x8C\x58" /* U+0131 */
ad88cddb
KW
155
156# define HYPHEN_UTF8 "\xCA\x41\x57" /* U+2010 */
ad88cddb
KW
157# define BOM_UTF8_FIRST_BYTE 0xDD /* U+FEFF */
158# define BOM_UTF8_TAIL "\x72\x65\x72" /* U+FEFF */
159
69bc4c1f
KW
160# define BOM_UTF8 "\xDD\x72\x65\x72" /* U+FEFF */
161
162# define REPLACEMENT_CHARACTER_UTF8 "\xDD\x72\x72\x70" /* U+FFFD */
163
566efd88
KW
164# define MAX_UNICODE_UTF8 "\xEE\x42\x72\x72\x72" /* U+10FFFF */
165
ad88cddb
KW
166# define NBSP_NATIVE 0x41 /* U+00A0 */
167# define NBSP_UTF8 "\x78\x41" /* U+00A0 */
168
169# define DEL_NATIVE 0x07 /* U+007F */
170# define CR_NATIVE 0x0D /* U+000D */
171# define LF_NATIVE 0x25 /* U+000A */
d804860b
KW
172# define VT_NATIVE 0x0B /* U+000B */
173# define ESC_NATIVE 0x27 /* U+001B */
ad88cddb 174# define LATIN_SMALL_LETTER_SHARP_S_NATIVE 0x59 /* U+00DF */
69ffc8e3 175# define LATIN_SMALL_LETTER_SHARP_S_UTF8 "\x80\x72" /* U+00DF */
ad88cddb
KW
176# define LATIN_SMALL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x47 /* U+00E5 */
177# define LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE 0x67 /* U+00C5 */
178# define LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE 0xDF /* U+00FF */
179# define MICRO_SIGN_NATIVE 0xA0 /* U+00B5 */
69ffc8e3 180# define MICRO_SIGN_UTF8 "\x78\x63" /* U+00B5 */
09cc440d 181# define MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C 0xF9 /* The max code point that isPRINT_A */
ad88cddb
KW
182
183#endif /* EBCDIC 037 */
184
b35552de 185/* The number of code points not matching \pC */
b6dbf1d3 186#define NON_OTHER_COUNT_FOR_USE_ONLY_BY_REGCOMP_DOT_C 143698
b35552de 187
3bfc1e70 188/* The highest code point that has any type of case change */
f2bfbac0 189#define HIGHEST_CASE_CHANGING_CP_FOR_USE_ONLY_BY_UTF8_DOT_C 0x1E943
3bfc1e70 190
6a5bc5ac 191#endif /* PERL_UNICODE_CONSTANTS_H_ */
d10c72f2 192
61dad979 193/* ex: set ro: */