19 Commits

Author SHA1 Message Date
Damien Neil
c1f5833288 all: replace deprecated io/ioutil calls
The io/ioutil package's features were moved to
the io and os packages in Go 1.16.

x/net depends on Go 1.18. Drop ioutil calls,
so gopls doesn't warn about them.

Change-Id: Ibdb576d94f250808ae285aa142e2fd41e7e9afc9
Reviewed-on: https://go-review.googlesource.com/c/net/+/586244
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-05-21 19:59:00 +00:00
Kunpei Sakai
e7e4b65ae6 html: improve coding style
Change-Id: I05c0ccbad41f5512f8096b0d15991d7d6b5d726e
Reviewed-on: https://go-review.googlesource.com/c/net/+/209398
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2019-12-07 00:06:13 +00:00
Andy Balholm
f1d3149ecb html/charset: replace EUC-KR test
The old test for EUC-KR was copied from the first web page that I could
find that was encoded in EUC-KR; the new one is the first line of
golang.org/x/text/internal/testtext.Korean.

Change-Id: I3de076256c935088a06138056cde216190766a6d
Reviewed-on: https://go-review.googlesource.com/18063
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
2016-01-08 17:00:32 +00:00
Marcel van Lohuizen
68a055e15f html/charset: verify correct UTF-8 behavior
Change-Id: I4083c38468981128c3d74310cd02335c35eafa5d
Reviewed-on: https://go-review.googlesource.com/17966
Reviewed-by: Andy Balholm <andy@balholm.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-19 10:34:51 +00:00
Marcel van Lohuizen
9b9d6d8d11 html/charset: handle unsupported code points for encoding
Change-Id: I11ffc61623496fae6b32e678c91f7609d71aefe5
Reviewed-on: https://go-review.googlesource.com/17961
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Andy Balholm <andy@balholm.com>
2015-12-17 16:33:40 +00:00
Marcel van Lohuizen
d28a91ad26 html/charset: use x/text/encoding/htmlindex
Saves duplication of work.

Change-Id: I33c715f33cb6cacd8522e480dc96ae71475c5b3c
Reviewed-on: https://go-review.googlesource.com/17805
Reviewed-by: Andy Balholm <andy@balholm.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
2015-12-17 11:26:21 +00:00
Marcel van Lohuizen
72b0708b72 html/charmap: update table with latest data
Change-Id: I7ae395999a3e61afa3a6ee15d076edae73d8a83b
Reviewed-on: https://go-review.googlesource.com/17800
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Reviewed-by: Andy Balholm <andy@balholm.com>
2015-12-14 17:39:18 +00:00
Ian Lance Taylor
e0403b4e00 html/charset/testdata: update licensing info in README
Update the licensing info following the instructions at
http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html#howtouse

Fixes golang/go#10398.

Change-Id: Ib37b2a696a5287f41d4e85da4eb7ec1cbb346301
Reviewed-on: https://go-review.googlesource.com/8978
Reviewed-by: Martin Packman <martin.packman@canonical.com>
Reviewed-by: Rob Pike <r@golang.org>
2015-05-08 23:18:43 +00:00
Andy Balholm
6460565bec x/net/html/charset: Change NewReaderByName to NewReaderLabel.
Change-Id: Ic4d1df0c4f7048a3e2472cca09ef9390bcfd149d
Reviewed-on: https://go-review.googlesource.com/4533
Reviewed-by: Rob Pike <r@golang.org>
2015-04-03 23:56:49 +00:00
Dmitry Savintsev
3d87fd621c x/net/html: Sync the html parser and atom with the current whatwg spec
The current documentation as well as set of atoms and attributes has
gotten slightly out of sync with the current state of the WHATWG
html5 specification. The change adds and removes several of the atoms
and attributes, updates the documentation (such as steps numbering in
inBodyEndTagFormatting) and modifies the spec URLs to https://

Change-Id: I6dfa52785858c1521301b20b1e585e19a08b1e98
Reviewed-on: https://go-review.googlesource.com/6173
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-03-03 04:37:39 +00:00
Andy Balholm
ec18079348 x/net/html/charset: add NewReaderByName
This provides a CharsetReader function for xml.Decoder.

Change-Id: Id00787bbdee90d267d38c84c98a06f9e10d93336
Reviewed-on: https://go-review.googlesource.com/4420
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2015-02-10 23:47:13 +00:00
David Symonds
8aa6e209cb net: add import comments.
Change-Id: Ifab0fdaec1d810d268b7c19ad30f476802203b37
2014-12-09 14:17:11 +11:00
Mikio Hara
ccf541d876 x/net/html/charset: add missing copyright
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/174240043
2014-11-17 10:54:40 +09:00
Mikio Hara
716c3ccf9b x/net/html/charset: fix nacl build
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/177880043
2014-11-17 10:54:21 +09:00
Andrew Gerrand
fbe893ddcd go.net: use golang.org/x/... import paths
LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/167030043
2014-11-10 09:04:43 +11:00
Andrew Balholm
3f04d1ffd7 go.net/html/charset: add NewReader
NewReader is a convenience function for finding the encoding of
an io.Reader and making a UTF-8 version of that Reader.

R=nigeltao
CC=golang-dev
https://golang.org/cl/43510043
2013-12-19 17:30:38 +11:00
Andrew Balholm
74213743f3 go.net/html/charset: implement the encoding sniffing algorithm
R=nigeltao
CC=golang-dev
https://golang.org/cl/31220043
2013-12-13 16:04:21 +11:00
Andrew Balholm
7eb0b7e953 go.net/html/charset: encoding names
Lookup now returns the canonical name as well as the Encoding.

This will make it easier for users to discover what encoding they
actually have as a return value from functions in this package.
They will also be able to store the name for re-use.

R=nigeltao, mpvl
CC=golang-dev
https://golang.org/cl/30090043
2013-11-23 10:13:36 +11:00
Andrew Balholm
e2719b3103 go.net/html/charset: new package
Implement retrieving encodings by name, according to the names listed
at http://encoding.spec.whatwg.org/#encodings

This is the first step toward implementing the encoding detection
algorithm.

R=nigeltao
CC=golang-dev
https://golang.org/cl/27110043
2013-11-19 21:51:02 +11:00