We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent afb9336 commit 81608d7Copy full SHA for 81608d7
message/fmt_test.go
@@ -257,10 +257,10 @@ var fmtTests = []struct {
257
{"%#q", "\U0010ffff", "``"},
258
{"%#+q", "\U0010ffff", "``"},
259
// Runes that are not valid.
260
- {"%q", string(0x110000), `"�"`},
261
- {"%+q", string(0x110000), `"\ufffd"`},
262
- {"%#q", string(0x110000), "`�`"},
263
- {"%#+q", string(0x110000), "`�`"},
+ {"%q", string(rune(0x110000)), `"�"`},
+ {"%+q", string(rune(0x110000)), `"\ufffd"`},
+ {"%#q", string(rune(0x110000)), "`�`"},
+ {"%#+q", string(rune(0x110000)), "`�`"},
264
265
// characters
266
{"%c", uint('x'), "x"},
@@ -1451,7 +1451,7 @@ func (flagPrinter) Format(f fmt.State, c rune) {
1451
s := "%"
1452
for i := 0; i < 128; i++ {
1453
if f.Flag(i) {
1454
- s += string(i)
+ s += string(rune(i))
1455
}
1456
1457
if w, ok := f.Width(); ok {
unicode/cldr/base.go
@@ -98,7 +98,7 @@ var charRe = regexp.MustCompile(`&#x[0-9a-fA-F]*;|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-
98
func replaceUnicode(s string) string {
99
if s[1] == '#' {
100
r, _ := strconv.ParseInt(s[3:len(s)-1], 16, 32)
101
- return string(r)
+ return string(rune(r))
102
103
r, _, _, _ := strconv.UnquoteChar(s, 0)
104
return string(r)
0 commit comments