Skip to content

Commit 6957e15

Browse files
authored
Make IO.getn and IO.read docs consistent (#15565)
1 parent b82c44a commit 6957e15

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

lib/elixir/lib/io.ex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,9 @@ defmodule IO do
152152
153153
The `device` is iterated as specified by the `line_or_chars` argument:
154154
155-
* if `line_or_chars` is an integer, it represents the number of characters
156-
according to the device encoding (either latin1 or utf8). The device is
157-
iterated by that number of characters. Use `binread/2` if you desire to
158-
read bytes.
155+
* if `line_or_chars` is an integer, it is the number of Unicode
156+
code points to be retrieved for devices open in Unicode/utf8 mode.
157+
Otherwise, it is the number of raw bytes to be retrieved.
159158
160159
* if `line_or_chars` is `:line`, the device is iterated line by line.
161160
CRLF newlines ("\r\n") are automatically normalized to "\n".
@@ -522,7 +521,7 @@ defmodule IO do
522521
end
523522

524523
@doc """
525-
Gets a number of bytes from IO device `:stdio`.
524+
Gets a number of characters from IO device `:stdio`.
526525
527526
If `:stdio` is a Unicode device, `count` implies
528527
the number of Unicode code points to be retrieved.
@@ -550,7 +549,7 @@ defmodule IO do
550549
end
551550

552551
@doc """
553-
Gets a number of bytes from the IO `device`.
552+
Gets a number of characters from the IO `device`.
554553
555554
If the IO `device` is a Unicode device, `count` implies
556555
the number of Unicode code points to be retrieved.

0 commit comments

Comments
 (0)