]> Cypherpunks repositories - gostls13.git/commit
strconv: change Quote to be Unicode-friendly,
authorRob Pike <r@golang.org>
Tue, 7 Jun 2011 12:23:08 +0000 (12:23 +0000)
committerRob Pike <r@golang.org>
Tue, 7 Jun 2011 12:23:08 +0000 (12:23 +0000)
commitf2f3b8fa99f4390b3ce0fdd921e7116228b7b5e1
treee738a2ffa6f69b0f843339849b71ac606ef27ea6
parent05348ab0c84a7e2c76864a156993ac7f4ed092cd
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.

R=golang-dev, gri, r
CC=golang-dev
https://golang.org/cl/4561061
src/pkg/fmt/fmt_test.go
src/pkg/go/scanner/scanner_test.go
src/pkg/strconv/quote.go
src/pkg/strconv/quote_test.go