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

Issue 4561061: code review 4561061: strconv: change Quote to be Unicode-friendly, (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by r
Modified:
13 years, 11 months ago
Reviewers:
rsc
CC:
golang-dev, gri, r2
Visibility:
Public.

Description

strconv: change Quote to be Unicode-friendly, add QuoteToASCII. The Quote and QuoteRune functions now let printable runes (as defined by unicode.IsPrint) through. When true 7-bit clean stuff is necessary, there are now two new functions: QuoteToASCII and QuoteRuneToASCII. Printf("%q") uses Quote. To get the old behavior, it will now be necessary to say Printf("%s", strconv.QuoteToASCII(s)) but that should rarely be necessary.

Patch Set 1 #

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

Total comments: 4

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

Total comments: 1

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

Total comments: 2

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

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -72 lines) Patch
M src/pkg/fmt/fmt_test.go View 3 chunks +7 lines, -7 lines 0 comments Download
M src/pkg/go/scanner/scanner_test.go View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/strconv/quote.go View 1 2 3 4 2 chunks +74 lines, -45 lines 0 comments Download
M src/pkg/strconv/quote_test.go View 1 2 3 4 5 4 chunks +43 lines, -19 lines 0 comments Download

Messages

Total messages: 14
r
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 11 months ago (2011-06-03 23:17:35 UTC) #1
r
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-06-03 23:27:01 UTC) #2
gri
LGMT http://codereview.appspot.com/4561061/diff/5/src/pkg/strconv/quote.go File src/pkg/strconv/quote.go (right): http://codereview.appspot.com/4561061/diff/5/src/pkg/strconv/quote.go#newcode17 src/pkg/strconv/quote.go:17: func quoteWith(s string, quote byte, ASCIIonly bool) string ...
13 years, 11 months ago (2011-06-03 23:45:28 UTC) #3
r
Hello golang-dev@googlegroups.com, gri@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-06-03 23:55:14 UTC) #4
r2
On 04/06/2011, at 9:45 AM, gri@golang.org wrote: > LGMT > > > http://codereview.appspot.com/4561061/diff/5/src/pkg/strconv/quote.go > File ...
13 years, 11 months ago (2011-06-03 23:55:52 UTC) #5
gri
LGTM http://codereview.appspot.com/4561061/diff/5001/src/pkg/strconv/quote.go File src/pkg/strconv/quote.go (right): http://codereview.appspot.com/4561061/diff/5001/src/pkg/strconv/quote.go#newcode70 src/pkg/strconv/quote.go:70: for j := uint(0); j < 4; j++ ...
13 years, 11 months ago (2011-06-04 00:08:41 UTC) #6
gri
of course: s := uint(12 ... On Fri, Jun 3, 2011 at 5:08 PM, <gri@golang.org> ...
13 years, 11 months ago (2011-06-04 00:09:14 UTC) #7
r
Hello golang-dev@googlegroups.com, gri@golang.org, r@google.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-06-04 00:18:18 UTC) #8
gri
LGTM http://codereview.appspot.com/4561061/diff/10001/src/pkg/strconv/quote.go File src/pkg/strconv/quote.go (right): http://codereview.appspot.com/4561061/diff/10001/src/pkg/strconv/quote.go#newcode71 src/pkg/strconv/quote.go:71: buf.WriteByte(lowerhex[(rune>>s)&0xF]) no need for the ()'s around the ...
13 years, 11 months ago (2011-06-04 00:27:03 UTC) #9
gri
PS: perhaps there should be a test case for 0xFFFD . On Fri, Jun 3, ...
13 years, 11 months ago (2011-06-04 00:28:33 UTC) #10
r
Hello golang-dev@googlegroups.com, gri@golang.org, r@google.com (cc: golang-dev@googlegroups.com), Please take another look.
13 years, 11 months ago (2011-06-04 06:40:02 UTC) #11
r2
your rewrite needed work because uints can't go negative, but it was easy to fix. ...
13 years, 11 months ago (2011-06-04 06:40:41 UTC) #12
r
*** Submitted as http://code.google.com/p/go/source/detail?r=997e823b0528 *** strconv: change Quote to be Unicode-friendly, add QuoteToASCII. The Quote ...
13 years, 11 months ago (2011-06-07 12:23:15 UTC) #13
rsc
13 years, 11 months ago (2011-06-07 19:56:35 UTC) #14
LGTM
Sign in to reply to this message.

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