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

Issue 6747043: code review 6747043: encoding/xml: correctly escape newline, carriage return... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 10 months ago by iant
Modified:
12 years, 10 months ago
Reviewers:
CC:
golang-dev, bradfitz
Visibility:
Public.

Description

encoding/xml: correctly escape newline, carriage return, and tab The generated encodings are those from http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping The change to the decoder ensures that we turn 
 in the input into \r, not \n.

Patch Set 1 #

Total comments: 4

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

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -15 lines) Patch
M src/pkg/encoding/xml/marshal_test.go View 1 2 1 chunk +21 lines, -0 lines 0 comments Download
M src/pkg/encoding/xml/xml.go View 1 2 4 chunks +20 lines, -15 lines 0 comments Download

Messages

Total messages: 7
iant
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 10 months ago (2012-10-18 17:54:20 UTC) #1
bradfitz
https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go File src/pkg/encoding/xml/xml.go (right): https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go#newcode1708 src/pkg/encoding/xml/xml.go:1708: esc = []byte(fmt.Sprintf("&#x%X;", c)) I'd just add more esc_foo ...
12 years, 10 months ago (2012-10-18 18:06:52 UTC) #2
iant
PTAL https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go File src/pkg/encoding/xml/xml.go (right): https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go#newcode1708 src/pkg/encoding/xml/xml.go:1708: esc = []byte(fmt.Sprintf("&#x%X;", c)) On 2012/10/18 18:06:53, bradfitz ...
12 years, 10 months ago (2012-10-18 19:00:36 UTC) #3
bradfitz
https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go File src/pkg/encoding/xml/xml.go (right): https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go#newcode971 src/pkg/encoding/xml/xml.go:971: } else if b0 == '\r' && b == ...
12 years, 10 months ago (2012-10-18 20:15:32 UTC) #4
iant
PTAL https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go File src/pkg/encoding/xml/xml.go (right): https://codereview.appspot.com/6747043/diff/1/src/pkg/encoding/xml/xml.go#newcode971 src/pkg/encoding/xml/xml.go:971: } else if b0 == '\r' && b ...
12 years, 10 months ago (2012-10-18 20:31:51 UTC) #5
bradfitz
LGTM On Thu, Oct 18, 2012 at 1:31 PM, <iant@golang.org> wrote: > PTAL > > ...
12 years, 10 months ago (2012-10-18 20:38:13 UTC) #6
iant
12 years, 10 months ago (2012-10-18 20:41:08 UTC) #7
*** Submitted as http://code.google.com/p/go/source/detail?r=bc9734d10a1d ***

encoding/xml: correctly escape newline, carriage return, and tab

The generated encodings are those from
http://www.w3.org/TR/2000/WD-xml-c14n-20000119.html#charescaping

The change to the decoder ensures that we turn &#xD; in the
input into \r, not \n.

R=golang-dev, bradfitz
CC=golang-dev
http://codereview.appspot.com/6747043
Sign in to reply to this message.

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