fmt: %q with byte value #63646
Labels
Documentation
Issues describing a change to documentation.
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
If I run this code:
I get this result:
everything seems OK except for the last two items. INVERTED EXCLAMATION MARK (U+00A1) is actually 0xC2 0xA1 in UTF-8, not just 0xA1. with
%c
, this is explained in the documentation:go/src/fmt/doc.go
Lines 26 to 33 in 693def1
but
%q
doesn't seem to be clear enough about what its doing. it seems with both%c
and%q
, a byte value is first converted to a rune before printing, but only%c
draws attention to that fact. I think the current behavior is correct, but the%q
value documentation should be more explicit about the conversion to a rune/Unicode code point.The text was updated successfully, but these errors were encountered: