summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2025-12-26 21:24:52 +0000
committerPeter Zhu <peter@peterzhu.ca>2025-12-27 13:28:57 -0500
commit8415f8faccffd426ed9c1168abddc2b3e727b659 (patch)
treeb91e2d0c68c3582384a0c4cb1d7277d8b7f5f822 /doc
parenta92c0342dd35efac8c08845b23412e5f70ecd769 (diff)
[DOC] Use Japanese for multi-byte characters
Diffstat (limited to 'doc')
-rw-r--r--doc/language/packed_data.rdoc18
1 files changed, 9 insertions, 9 deletions
diff --git a/doc/language/packed_data.rdoc b/doc/language/packed_data.rdoc
index 088e6d8653..597db5139f 100644
--- a/doc/language/packed_data.rdoc
+++ b/doc/language/packed_data.rdoc
@@ -457,15 +457,15 @@ for one byte in the input or output string.
"foo ".unpack('A4') # => ["foo"]
"foo".unpack('A4') # => ["foo"]
- russian = "\u{442 435 441 442}" # => "тест"
- russian.size # => 4
- russian.bytesize # => 8
- [russian].pack('A') # => "\xD1"
- [russian].pack('A*') # => "\xD1\x82\xD0\xB5\xD1\x81\xD1\x82"
- russian.unpack('A') # => ["\xD1"]
- russian.unpack('A2') # => ["\xD1\x82"]
- russian.unpack('A4') # => ["\xD1\x82\xD0\xB5"]
- russian.unpack('A*') # => ["\xD1\x82\xD0\xB5\xD1\x81\xD1\x82"]
+ japanese = 'こんにちは'
+ japanese.size # => 5
+ japanese.bytesize # => 15
+ [japanese].pack('A') # => "\xE3"
+ [japanese].pack('A*') # => "\xE3\x81\x93\xE3\x82\x93\xE3\x81\xAB\xE3\x81\xA1\xE3\x81\xAF"
+ japanese.unpack('A') # => ["\xE3"]
+ japanese.unpack('A2') # => ["\xE3\x81"]
+ japanese.unpack('A4') # => ["\xE3\x81\x93\xE3"]
+ japanese.unpack('A*') # => ["\xE3\x81\x93\xE3\x82\x93\xE3\x81\xAB\xE3\x81\xA1\xE3\x81\xAF"]
- <tt>'a'</tt> - Arbitrary binary string (null padded; count is width):