@@ -19,10 +19,10 @@ With no arguments given, reads a line using the default record separator
1919 strio.eof? # => true
2020 strio.gets # => nil
2121
22- strio = StringIO.new('тест ') # Four 2-byte characters.
22+ strio = StringIO.new('Привет ') # Six 2-byte characters
2323 strio.pos # => 0
24- strio.gets # => "тест "
25- strio.pos # => 8
24+ strio.gets # => "Привет "
25+ strio.pos # => 12
2626
2727<b>Argument +sep+</b>
2828
@@ -67,11 +67,11 @@ but in other cases the position may be anywhere:
6767
6868The position need not be at a character boundary:
6969
70- strio = StringIO.new('тест ') # Four 2-byte characters.
71- strio.pos = 2 # At beginning of second character.
72- strio.gets # => "ест "
73- strio.pos = 3 # In middle of second character.
74- strio.gets # => "\xB5ст "
70+ strio = StringIO.new('Привет ') # Six 2-byte characters.
71+ strio.pos = 2 # At beginning of second character.
72+ strio.gets # => "ривет "
73+ strio.pos = 3 # In middle of second character.
74+ strio.gets # => "\x80ивет "
7575
7676<b>Special Record Separators</b>
7777
@@ -95,4 +95,5 @@ removes the trailing newline (if any) from the returned line:
9595 strio.gets # => "First line\n"
9696 strio.gets(chomp: true) # => "Second line"
9797
98- Related: StringIO.each_line.
98+ Related: #each_line, #readlines,
99+ {Kernel#puts}[https://docs.ruby-lang.org/en/master/Kernel.html#method-i-puts].
0 commit comments