| 1 | #include <iostream>
|
|---|
| 2 | #include <boost/regex/icu.hpp>
|
|---|
| 3 |
|
|---|
| 4 | int main(void)
|
|---|
| 5 | {
|
|---|
| 6 | boost::make_u32regex("\xed\xa0\x80"); // single lowest lead surrogate U+D800
|
|---|
| 7 | boost::make_u32regex("\xed\xaf\xbf"); // single highest lead surrogate U+DBFF
|
|---|
| 8 | boost::make_u32regex("\xed\xb0\x80"); // single lowest trail surrogate U+DC00
|
|---|
| 9 | boost::make_u32regex("\xed\xbf\xbf"); // single highest trail surrogate U+DFFF
|
|---|
| 10 |
|
|---|
| 11 | // overlong encodings (created by left-padding with zero bits)
|
|---|
| 12 | boost::make_u32regex("\xc0\x80"); // illegal 2-byte encoding of 1-byte character U+0000
|
|---|
| 13 | boost::make_u32regex("\xe0\x80\x80"); // illegal 3-byte encoding of 1-byte character U+0000
|
|---|
| 14 | boost::make_u32regex("\xf0\x80\x80\x80"); // illegal 4-byte encoding of 1-byte character U+0000
|
|---|
| 15 |
|
|---|
| 16 | boost::make_u32regex("\xc1\xbf"); // illegal 2-byte encoding of 1-byte character U+007F
|
|---|
| 17 | boost::make_u32regex("\xe0\x81\xbf"); // illegal 3-byte encoding of 1-byte character U+007F
|
|---|
| 18 | boost::make_u32regex("\xf0\x80\x81\xbf"); // illegal 4-byte encoding of 1-byte character U+007F
|
|---|
| 19 |
|
|---|
| 20 | boost::make_u32regex("\xe0\x82\x80"); // illegal 3-byte encoding of 2-byte character U+0080
|
|---|
| 21 | boost::make_u32regex("\xf0\x80\x82\x80"); // illegal 4-byte encoding of 2-byte character U+0080
|
|---|
| 22 |
|
|---|
| 23 | boost::make_u32regex("\xe0\x9f\xbf"); // illegal 3-byte encoding of 2-byte character U+07FF
|
|---|
| 24 | boost::make_u32regex("\xf0\x80\x9f\xbf"); // illegal 4-byte encoding of 2-byte character U+07FF
|
|---|
| 25 |
|
|---|
| 26 | boost::make_u32regex("\xf0\x80\xa0\x80"); // illegal 4-byte encoding of 3-byte character U+0800
|
|---|
| 27 |
|
|---|
| 28 | boost::make_u32regex("\xf0\x8f\xbf\xbf"); // illegal 4-byte encoding of 3-byte character U+FFFF
|
|---|
| 29 |
|
|---|
| 30 | return 0;
|
|---|
| 31 | }
|
|---|