New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strconv: Quote method that uses IsGraphic not IsPrint #11511
Labels
Milestone
Comments
Is %+q available for doing this from fmt? |
Should probably be QuoteToGraphic like existing QuoteToASCII. |
CL https://golang.org/cl/14184 mentions this issue. |
robpike
added a commit
that referenced
this issue
Sep 8, 2015
This version of quoting allows runes in category Zs, such as the ideographic space characters, to be passed through unquoted. Still to do (maybe): A way to access this from Printf. Updates #11511. Change-Id: I3bae84b1aa0bc1b885318d3f67c5f451099a2a5a Reviewed-on: https://go-review.googlesource.com/14184 Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
There are no suitable flags available in Printf's %q verb, so without something awful and unprecedented like a double flag %#+q, this is the best we can do. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The IsPrint method is of our own design and makes sense, but it means that ideographic languages using for instance U+3000, the ideographic space, quote badly.
There should be a variant, perhaps strconv.QuoteGraphic, that offers the distinction, or perhaps a more general method that allows a func to make the definition.
The text was updated successfully, but these errors were encountered: