Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2055)

Issue 4437061: code review 4437061: xml: Parser hook for non-UTF-8 charset converters (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by bradfitz
Modified:
13 years, 1 month ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

xml: Parser hook for non-UTF-8 charset converters Adds an optional hook to Parser to let charset converters step in when a processing directive with a non-UTF-8 encoding is specified. (Open to alternative proposals too...)

Patch Set 1 #

Patch Set 2 : diff -r 9658d8fbd2a0 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 9658d8fbd2a0 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 9658d8fbd2a0 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 5 : diff -r c4b835aa75c1 https://go.googlecode.com/hg/ #

Total comments: 6

Patch Set 6 : diff -r c4b835aa75c1 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r c4b835aa75c1 https://go.googlecode.com/hg/ #

Patch Set 8 : diff -r c4b835aa75c1 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 9 : diff -r 28cfb3b02e19 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -11 lines) Patch
M src/pkg/xml/xml.go View 1 2 3 4 5 6 7 5 chunks +62 lines, -11 lines 0 comments Download
M src/pkg/xml/xml_test.go View 1 2 3 4 5 6 4 chunks +94 lines, -0 lines 0 comments Download

Messages

Total messages: 18
bradfitz
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 1 month ago (2011-04-21 01:22:20 UTC) #1
rsc
Seems reasonable. The ByteReader function signature doesn't seem quite right. I think you want a ...
13 years, 1 month ago (2011-04-21 11:53:02 UTC) #2
bradfitz
Hello golang-dev@googlegroups.com, rsc (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 1 month ago (2011-04-21 17:36:03 UTC) #3
bradfitz
Done. For some reason I thought NewParser took a ByteReader which led me down that ...
13 years, 1 month ago (2011-04-21 17:38:13 UTC) #4
rsc
http://codereview.appspot.com/4437061/diff/9001/src/pkg/xml/xml.go File src/pkg/xml/xml.go (right): http://codereview.appspot.com/4437061/diff/9001/src/pkg/xml/xml.go#newcode171 src/pkg/xml/xml.go:171: CharsetReader func(charset string, input io.Reader) io.Reader CharsetReader should return ...
13 years, 1 month ago (2011-04-21 19:10:40 UTC) #5
bradfitz
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 1 month ago (2011-04-21 19:56:17 UTC) #6
rsc
LGTM http://codereview.appspot.com/4437061/diff/2002/src/pkg/xml/xml.go File src/pkg/xml/xml.go (right): http://codereview.appspot.com/4437061/diff/2002/src/pkg/xml/xml.go#newcode509 src/pkg/xml/xml.go:509: p.err = fmt.Errorf("xml: getting CharsetReader for encoding %q: ...
13 years, 1 month ago (2011-04-21 20:01:17 UTC) #7
bradfitz
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 1 month ago (2011-04-21 20:07:35 UTC) #8
bradfitz
http://codereview.appspot.com/4437061/diff/2002/src/pkg/xml/xml.go File src/pkg/xml/xml.go (right): http://codereview.appspot.com/4437061/diff/2002/src/pkg/xml/xml.go#newcode509 src/pkg/xml/xml.go:509: p.err = fmt.Errorf("xml: getting CharsetReader for encoding %q: %v", ...
13 years, 1 month ago (2011-04-21 20:07:44 UTC) #9
rsc
> I'd rather see this than a nil pointer crash, though. > > If we ...
13 years, 1 month ago (2011-04-21 20:12:02 UTC) #10
bradfitz
Hello rsc (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 1 month ago (2011-04-21 20:18:16 UTC) #11
bradfitz
On Thu, Apr 21, 2011 at 1:11 PM, Russ Cox <rsc@golang.org> wrote: > > I'd ...
13 years, 1 month ago (2011-04-21 20:19:00 UTC) #12
rsc
http://codereview.appspot.com/4437061/diff/17001/src/pkg/xml/xml.go File src/pkg/xml/xml.go (right): http://codereview.appspot.com/4437061/diff/17001/src/pkg/xml/xml.go#newcode512 src/pkg/xml/xml.go:512: if newr == nil { still here ?
13 years, 1 month ago (2011-04-21 20:40:55 UTC) #13
bradfitz
On Thu, Apr 21, 2011 at 1:40 PM, <rsc@golang.org> wrote: > > http://codereview.appspot.com/4437061/diff/17001/src/pkg/xml/xml.go > > ...
13 years, 1 month ago (2011-04-21 21:00:54 UTC) #14
rsc
> But with a panic now. Not really accepted like it was before. You'd prefer ...
13 years, 1 month ago (2011-04-21 21:09:18 UTC) #15
bradfitz
On Thu, Apr 21, 2011 at 2:09 PM, Russ Cox <rsc@golang.org> wrote: > > But ...
13 years, 1 month ago (2011-04-21 21:21:16 UTC) #16
rsc
LGTM On Apr 21, 2011 5:21 PM, "Brad Fitzpatrick" <bradfitz@golang.org> wrote: > On Thu, Apr ...
13 years, 1 month ago (2011-04-21 21:34:08 UTC) #17
bradfitz
13 years, 1 month ago (2011-04-21 21:37:35 UTC) #18
*** Submitted as http://code.google.com/p/go/source/detail?r=9f771f92ac93 ***

xml: Parser hook for non-UTF-8 charset converters

Adds an optional hook to Parser to let charset
converters step in when a processing directive
with a non-UTF-8 encoding is specified.

(Open to alternative proposals too...)

R=rsc
CC=golang-dev
http://codereview.appspot.com/4437061
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b