[DOC] Fix examples for u packing directive

The directive is a lowercase `u` instead of an uppercase `U`. Adjusted
input and output to match.

Reported by Leah Neukirchen.
This commit is contained in:
Adam Daniels 2024-04-02 10:07:52 -04:00 committed by Nobuyoshi Nakada
parent 24a7407960
commit b664590c4d

View File

@ -554,10 +554,12 @@ for one byte in the input or output string.
- <tt>'u'</tt> - UU-encoded string:
[0].pack("U") # => "\u0000"
[0x3fffffff].pack("U") # => "\xFC\xBF\xBF\xBF\xBF\xBF"
[0x40000000].pack("U") # => "\xFD\x80\x80\x80\x80\x80"
[0x7fffffff].pack("U") # => "\xFD\xBF\xBF\xBF\xBF\xBF"
[""].pack("u") # => ""
["a"].pack("u") # => "!80``\n"
["aaa"].pack("u") # => "#86%A\n"
"".unpack("u") # => [""]
"#86)C\n".unpack("u") # => ["abc"]
== Offset Directives