1
0
mirror of https://github.com/golang/go synced 2024-11-26 07:27:59 -07:00

all: upgrade Unicode from 13.0.0 to 15.0.0

Update unicode/tables.go to reflect changes in the Unicode Standard up to Unicode 15.0.0, released 13 Sept 2022.

In order to accommodate this update, strconv/isPrint has been updated to reflect changes in printable characters.

Also changed is template/exec_test.go for both text and html packages- in the test "TestJSEscaping", rune U+FDFF was used as a placeholder for an unprintable character. This codepoint was assigned and made printable in Unicode 14.0.0, breaking this test. It has been replaced with the assigned and never-printable U+FFFE to fix the test and provide resiliency in the future.

This upgrade bypasses Unicode 14.0.0, but is compatible.

Updates #48621
Fixes #55079
This commit is contained in:
weebney 2022-12-12 13:14:53 -05:00
parent 27301e8247
commit c8885cab7a
6 changed files with 737 additions and 371 deletions

View File

@ -501,6 +501,7 @@ pkg text/template/parse, type Node interface { Copy, String, Type }
pkg unicode, const Version = "10.0.0"
pkg unicode, const Version = "11.0.0"
pkg unicode, const Version = "12.0.0"
pkg unicode, const Version = "13.0.0"
pkg unicode, const Version = "6.2.0"
pkg unicode, const Version = "6.3.0"
pkg unicode, const Version = "7.0.0"

8
api/next/55079.txt Normal file
View File

@ -0,0 +1,8 @@
pkg unicode, const Version = "15.0.0" #55079
pkg unicode, var Cypro_Minoan *RangeTable #55079
pkg unicode, var Kawi *RangeTable #55079
pkg unicode, var Nag_Mundari *RangeTable #55079
pkg unicode, var Old_Uyghur *RangeTable #55079
pkg unicode, var Tangsa *RangeTable #55079
pkg unicode, var Toto *RangeTable #55079
pkg unicode, var Vithkuqi *RangeTable #55079

View File

@ -920,7 +920,7 @@ func TestJSEscaping(t *testing.T) {
{`'foo`, `\'foo`},
{`Go "jump" \`, `Go \"jump\" \\`},
{`Yukihiro says "今日は世界"`, `Yukihiro says \"今日は世界\"`},
{"unprintable \uFDFF", `unprintable \uFDFF`},
{"unprintable \uFFFE", `unprintable \uFFFE`},
{`<html>`, `\u003Chtml\u003E`},
{`no = in attributes`, `no \u003D in attributes`},
{`&#x27; does not become HTML entity`, `\u0026#x27; does not become HTML entity`},

View File

@ -6,7 +6,7 @@
package strconv
// (434+132+95)*2 + (468)*4 = 3194 bytes
// (424+133+112)*2 + (508)*4 = 3370 bytes
var isPrint16 = []uint16{
0x0020, 0x007e,
@ -17,16 +17,15 @@ var isPrint16 = []uint16{
0x058d, 0x05c7,
0x05d0, 0x05ea,
0x05ef, 0x05f4,
0x0606, 0x061b,
0x061e, 0x070d,
0x0606, 0x070d,
0x0710, 0x074a,
0x074d, 0x07b1,
0x07c0, 0x07fa,
0x07fd, 0x082d,
0x0830, 0x085b,
0x085e, 0x086a,
0x08a0, 0x08c7,
0x08d3, 0x098c,
0x0870, 0x088e,
0x0898, 0x098c,
0x098f, 0x0990,
0x0993, 0x09b2,
0x09b6, 0x09b9,
@ -71,15 +70,16 @@ var isPrint16 = []uint16{
0x0bd7, 0x0bd7,
0x0be6, 0x0bfa,
0x0c00, 0x0c39,
0x0c3d, 0x0c4d,
0x0c3c, 0x0c4d,
0x0c55, 0x0c5a,
0x0c5d, 0x0c5d,
0x0c60, 0x0c63,
0x0c66, 0x0c6f,
0x0c77, 0x0cb9,
0x0cbc, 0x0ccd,
0x0cd5, 0x0cd6,
0x0cde, 0x0ce3,
0x0ce6, 0x0cf2,
0x0cdd, 0x0ce3,
0x0ce6, 0x0cf3,
0x0d00, 0x0d4f,
0x0d54, 0x0d63,
0x0d66, 0x0d96,
@ -92,8 +92,7 @@ var isPrint16 = []uint16{
0x0e01, 0x0e3a,
0x0e3f, 0x0e5b,
0x0e81, 0x0ebd,
0x0ec0, 0x0ecd,
0x0ed0, 0x0ed9,
0x0ec0, 0x0ed9,
0x0edc, 0x0edf,
0x0f00, 0x0f6c,
0x0f71, 0x0fda,
@ -112,15 +111,14 @@ var isPrint16 = []uint16{
0x13f8, 0x13fd,
0x1400, 0x169c,
0x16a0, 0x16f8,
0x1700, 0x1714,
0x1720, 0x1736,
0x1700, 0x1715,
0x171f, 0x1736,
0x1740, 0x1753,
0x1760, 0x1773,
0x1780, 0x17dd,
0x17e0, 0x17e9,
0x17f0, 0x17f9,
0x1800, 0x180d,
0x1810, 0x1819,
0x1800, 0x1819,
0x1820, 0x1878,
0x1880, 0x18aa,
0x18b0, 0x18f5,
@ -137,10 +135,9 @@ var isPrint16 = []uint16{
0x1a7f, 0x1a89,
0x1a90, 0x1a99,
0x1aa0, 0x1aad,
0x1ab0, 0x1ac0,
0x1b00, 0x1b4b,
0x1b50, 0x1b7c,
0x1b80, 0x1bf3,
0x1ab0, 0x1ace,
0x1b00, 0x1b4c,
0x1b50, 0x1bf3,
0x1bfc, 0x1c37,
0x1c3b, 0x1c49,
0x1c4d, 0x1c88,
@ -159,7 +156,7 @@ var isPrint16 = []uint16{
0x2030, 0x205e,
0x2070, 0x2071,
0x2074, 0x209c,
0x20a0, 0x20bf,
0x20a0, 0x20c0,
0x20d0, 0x20f0,
0x2100, 0x218b,
0x2190, 0x2426,
@ -171,21 +168,20 @@ var isPrint16 = []uint16{
0x2d30, 0x2d67,
0x2d6f, 0x2d70,
0x2d7f, 0x2d96,
0x2da0, 0x2e52,
0x2da0, 0x2e5d,
0x2e80, 0x2ef3,
0x2f00, 0x2fd5,
0x2ff0, 0x2ffb,
0x3001, 0x3096,
0x3099, 0x30ff,
0x3105, 0x31e3,
0x31f0, 0x9ffc,
0xa000, 0xa48c,
0x31f0, 0xa48c,
0xa490, 0xa4c6,
0xa4d0, 0xa62b,
0xa640, 0xa6f7,
0xa700, 0xa7bf,
0xa7c2, 0xa7ca,
0xa7f5, 0xa82c,
0xa700, 0xa7ca,
0xa7d0, 0xa7d9,
0xa7f2, 0xa82c,
0xa830, 0xa839,
0xa840, 0xa877,
0xa880, 0xa8c5,
@ -211,12 +207,11 @@ var isPrint16 = []uint16{
0xfa70, 0xfad9,
0xfb00, 0xfb06,
0xfb13, 0xfb17,
0xfb1d, 0xfbc1,
0xfbd3, 0xfd3f,
0xfd50, 0xfd8f,
0xfb1d, 0xfbc2,
0xfbd3, 0xfd8f,
0xfd92, 0xfdc7,
0xfdf0, 0xfdfd,
0xfe00, 0xfe19,
0xfdcf, 0xfdcf,
0xfdf0, 0xfe19,
0xfe20, 0xfe6b,
0xfe70, 0xfefc,
0xff01, 0xffbe,
@ -235,10 +230,10 @@ var isNotPrint16 = []uint16{
0x03a2,
0x0530,
0x0590,
0x061c,
0x06dd,
0x083f,
0x085f,
0x08b5,
0x08e2,
0x0984,
0x09a9,
@ -301,6 +296,7 @@ var isNotPrint16 = []uint16{
0x0ea6,
0x0ec5,
0x0ec7,
0x0ecf,
0x0f48,
0x0f98,
0x0fbd,
@ -316,12 +312,12 @@ var isNotPrint16 = []uint16{
0x12d7,
0x1311,
0x1680,
0x170d,
0x176d,
0x1771,
0x180e,
0x191f,
0x1a5f,
0x1dfa,
0x1b7f,
0x1f58,
0x1f5a,
0x1f5c,
@ -332,8 +328,6 @@ var isNotPrint16 = []uint16{
0x1ff5,
0x208f,
0x2b96,
0x2c2f,
0x2c5f,
0x2d26,
0x2da7,
0x2daf,
@ -348,6 +342,8 @@ var isNotPrint16 = []uint16{
0x3130,
0x318f,
0x321f,
0xa7d2,
0xa7d4,
0xa9ce,
0xa9ff,
0xab27,
@ -386,10 +382,11 @@ var isPrint32 = []uint32{
0x0104d8, 0x0104fb,
0x010500, 0x010527,
0x010530, 0x010563,
0x01056f, 0x01056f,
0x01056f, 0x0105bc,
0x010600, 0x010736,
0x010740, 0x010755,
0x010760, 0x010767,
0x010780, 0x0107ba,
0x010800, 0x010805,
0x010808, 0x010838,
0x01083c, 0x01083c,
@ -422,19 +419,20 @@ var isPrint32 = []uint32{
0x010d30, 0x010d39,
0x010e60, 0x010ead,
0x010eb0, 0x010eb1,
0x010f00, 0x010f27,
0x010efd, 0x010f27,
0x010f30, 0x010f59,
0x010f70, 0x010f89,
0x010fb0, 0x010fcb,
0x010fe0, 0x010ff6,
0x011000, 0x01104d,
0x011052, 0x01106f,
0x01107f, 0x0110c1,
0x011052, 0x011075,
0x01107f, 0x0110c2,
0x0110d0, 0x0110e8,
0x0110f0, 0x0110f9,
0x011100, 0x011147,
0x011150, 0x011176,
0x011180, 0x0111f4,
0x011200, 0x01123e,
0x011200, 0x011241,
0x011280, 0x0112a9,
0x0112b0, 0x0112ea,
0x0112f0, 0x0112f9,
@ -456,11 +454,11 @@ var isPrint32 = []uint32{
0x011600, 0x011644,
0x011650, 0x011659,
0x011660, 0x01166c,
0x011680, 0x0116b8,
0x011680, 0x0116b9,
0x0116c0, 0x0116c9,
0x011700, 0x01171a,
0x01171d, 0x01172b,
0x011730, 0x01173f,
0x011730, 0x011746,
0x011800, 0x01183b,
0x0118a0, 0x0118f2,
0x0118ff, 0x011906,
@ -473,7 +471,8 @@ var isPrint32 = []uint32{
0x0119da, 0x0119e4,
0x011a00, 0x011a47,
0x011a50, 0x011aa2,
0x011ac0, 0x011af8,
0x011ab0, 0x011af8,
0x011b00, 0x011b09,
0x011c00, 0x011c45,
0x011c50, 0x011c6c,
0x011c70, 0x011c8f,
@ -484,16 +483,20 @@ var isPrint32 = []uint32{
0x011d60, 0x011d98,
0x011da0, 0x011da9,
0x011ee0, 0x011ef8,
0x011f00, 0x011f3a,
0x011f3e, 0x011f59,
0x011fb0, 0x011fb0,
0x011fc0, 0x011ff1,
0x011fff, 0x012399,
0x012400, 0x012474,
0x012480, 0x012543,
0x013000, 0x01342e,
0x012f90, 0x012ff2,
0x013000, 0x01342f,
0x013440, 0x013455,
0x014400, 0x014646,
0x016800, 0x016a38,
0x016a40, 0x016a69,
0x016a6e, 0x016a6f,
0x016a6e, 0x016ac9,
0x016ad0, 0x016aed,
0x016af0, 0x016af5,
0x016b00, 0x016b45,
@ -508,8 +511,10 @@ var isPrint32 = []uint32{
0x017000, 0x0187f7,
0x018800, 0x018cd5,
0x018d00, 0x018d08,
0x01b000, 0x01b11e,
0x01aff0, 0x01b122,
0x01b132, 0x01b132,
0x01b150, 0x01b152,
0x01b155, 0x01b155,
0x01b164, 0x01b167,
0x01b170, 0x01b2fb,
0x01bc00, 0x01bc6a,
@ -517,11 +522,15 @@ var isPrint32 = []uint32{
0x01bc80, 0x01bc88,
0x01bc90, 0x01bc99,
0x01bc9c, 0x01bc9f,
0x01cf00, 0x01cf2d,
0x01cf30, 0x01cf46,
0x01cf50, 0x01cfc3,
0x01d000, 0x01d0f5,
0x01d100, 0x01d126,
0x01d129, 0x01d172,
0x01d17b, 0x01d1e8,
0x01d17b, 0x01d1ea,
0x01d200, 0x01d245,
0x01d2c0, 0x01d2d3,
0x01d2e0, 0x01d2f3,
0x01d300, 0x01d356,
0x01d360, 0x01d378,
@ -534,15 +543,21 @@ var isPrint32 = []uint32{
0x01d6a8, 0x01d7cb,
0x01d7ce, 0x01da8b,
0x01da9b, 0x01daaf,
0x01df00, 0x01df1e,
0x01df25, 0x01df2a,
0x01e000, 0x01e018,
0x01e01b, 0x01e02a,
0x01e030, 0x01e06d,
0x01e08f, 0x01e08f,
0x01e100, 0x01e12c,
0x01e130, 0x01e13d,
0x01e140, 0x01e149,
0x01e14e, 0x01e14f,
0x01e290, 0x01e2ae,
0x01e2c0, 0x01e2f9,
0x01e2ff, 0x01e2ff,
0x01e800, 0x01e8c4,
0x01e4d0, 0x01e4f9,
0x01e7e0, 0x01e8c4,
0x01e8c7, 0x01e8d6,
0x01e900, 0x01e94b,
0x01e950, 0x01e959,
@ -568,11 +583,12 @@ var isPrint32 = []uint32{
0x01f250, 0x01f251,
0x01f260, 0x01f265,
0x01f300, 0x01f6d7,
0x01f6e0, 0x01f6ec,
0x01f6dc, 0x01f6ec,
0x01f6f0, 0x01f6fc,
0x01f700, 0x01f773,
0x01f780, 0x01f7d8,
0x01f700, 0x01f776,
0x01f77b, 0x01f7d9,
0x01f7e0, 0x01f7eb,
0x01f7f0, 0x01f7f0,
0x01f800, 0x01f80b,
0x01f810, 0x01f847,
0x01f850, 0x01f859,
@ -581,22 +597,22 @@ var isPrint32 = []uint32{
0x01f8b0, 0x01f8b1,
0x01f900, 0x01fa53,
0x01fa60, 0x01fa6d,
0x01fa70, 0x01fa74,
0x01fa78, 0x01fa7a,
0x01fa80, 0x01fa86,
0x01fa90, 0x01faa8,
0x01fab0, 0x01fab6,
0x01fac0, 0x01fac2,
0x01fad0, 0x01fad6,
0x01fa70, 0x01fa7c,
0x01fa80, 0x01fa88,
0x01fa90, 0x01fac5,
0x01face, 0x01fadb,
0x01fae0, 0x01fae8,
0x01faf0, 0x01faf8,
0x01fb00, 0x01fbca,
0x01fbf0, 0x01fbf9,
0x020000, 0x02a6dd,
0x02a700, 0x02b734,
0x020000, 0x02a6df,
0x02a700, 0x02b739,
0x02b740, 0x02b81d,
0x02b820, 0x02cea1,
0x02ceb0, 0x02ebe0,
0x02f800, 0x02fa1d,
0x030000, 0x03134a,
0x031350, 0x0323af,
0x0e0100, 0x0e01ef,
}
@ -607,6 +623,15 @@ var isNotPrint32 = []uint16{ // add 0x10000 to each entry
0x003e,
0x018f,
0x039e,
0x057b,
0x058b,
0x0593,
0x0596,
0x05a2,
0x05b2,
0x05ba,
0x0786,
0x07b1,
0x0809,
0x0836,
0x0856,
@ -644,10 +669,15 @@ var isNotPrint32 = []uint16{ // add 0x10000 to each entry
0x1d69,
0x1d8f,
0x1d92,
0x1f11,
0x246f,
0x6a5f,
0x6abf,
0x6b5a,
0x6b62,
0xaff4,
0xaffc,
0xafff,
0xd455,
0xd49d,
0xd4ad,
@ -665,6 +695,10 @@ var isNotPrint32 = []uint16{ // add 0x10000 to each entry
0xe007,
0xe022,
0xe025,
0xe7e7,
0xe7ec,
0xe7ef,
0xe7ff,
0xee04,
0xee20,
0xee23,
@ -693,8 +727,7 @@ var isNotPrint32 = []uint16{ // add 0x10000 to each entry
0xeeaa,
0xf0c0,
0xf0d0,
0xf979,
0xf9cc,
0xfabe,
0xfb93,
}

View File

@ -949,7 +949,7 @@ func TestJSEscaping(t *testing.T) {
{`'foo`, `\'foo`},
{`Go "jump" \`, `Go \"jump\" \\`},
{`Yukihiro says "今日は世界"`, `Yukihiro says \"今日は世界\"`},
{"unprintable \uFDFF", `unprintable \uFDFF`},
{"unprintable \uFFFE", `unprintable \uFFFE`},
{`<html>`, `\u003Chtml\u003E`},
{`no = in attributes`, `no \u003D in attributes`},
{`&#x27; does not become HTML entity`, `\u0026#x27; does not become HTML entity`},

File diff suppressed because it is too large Load Diff