Skip to content

Commit ce13745

Browse files
committed
idna: update from x/text
CL 359634: use nontransitional processing in Go 1.18 CL 317731: fix int32 overflows Updates golang/go#46001 Updates golang/go#47510 Updates golang/go#28233 Change-Id: I2d9cdf5caa44f7c9b2834a256e7464b6edaae9ef Reviewed-on: https://go-review.googlesource.com/c/net/+/360381 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 parent 7594919 commit ce13745

6 files changed

+69
-32
lines changed

idna/example_test.go

+13-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
2-
31
// Copyright 2017 The Go Authors. All rights reserved.
42
// Use of this source code is governed by a BSD-style
53
// license that can be found in the LICENSE file.
@@ -15,27 +13,26 @@ import (
1513
func ExampleProfile() {
1614
// Raw Punycode has no restrictions and does no mappings.
1715
fmt.Println(idna.ToASCII(""))
18-
fmt.Println(idna.ToASCII("*.faß.com"))
19-
fmt.Println(idna.Punycode.ToASCII("*.faß.com"))
16+
fmt.Println(idna.ToASCII("*.GÖPHER.com"))
17+
fmt.Println(idna.Punycode.ToASCII("*.GÖPHER.com"))
2018

21-
// Rewrite IDN for lookup. This (currently) uses transitional mappings to
22-
// find a balance between IDNA2003 and IDNA2008 compatibility.
19+
// Rewrite IDN for lookup.
2320
fmt.Println(idna.Lookup.ToASCII(""))
24-
fmt.Println(idna.Lookup.ToASCII("www.faß.com"))
21+
fmt.Println(idna.Lookup.ToASCII("www.GÖPHER.com"))
2522

26-
// Convert an IDN to ASCII for registration purposes. This changes the
27-
// encoding, but reports an error if the input was illformed.
28-
fmt.Println(idna.Registration.ToASCII(""))
29-
fmt.Println(idna.Registration.ToASCII("www.faß.com"))
23+
// Convert an IDN to ASCII for registration purposes.
24+
// This reports an error if the input was illformed.
25+
fmt.Println(idna.Registration.ToASCII("www.GÖPHER.com"))
26+
fmt.Println(idna.Registration.ToASCII("www.göpher.com"))
3027

3128
// Output:
3229
// <nil>
33-
// *.xn--fa-hia.com <nil>
34-
// *.xn--fa-hia.com <nil>
30+
// *.xn--GPHER-1oa.com <nil>
31+
// *.xn--GPHER-1oa.com <nil>
3532
// <nil>
36-
// www.fass.com <nil>
37-
// idna: invalid label ""
38-
// www.xn--fa-hia.com <nil>
33+
// www.xn--gpher-jua.com <nil>
34+
// www.xn--GPHER-1oa.com idna: disallowed rune U+0047
35+
// www.xn--gpher-jua.com <nil>
3936
}
4037

4138
func ExampleNew() {

idna/go118.go

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

idna/idna10.0.0.go

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

idna/idna9.0.0.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

idna/pre_go118.go

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

idna/punycode.go

+25-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)