|
202 | 202 |
|
203 | 203 | Returns a new write-only I/O stream, which converts any text in the encoding `from`
|
204 | 204 | written to it into text in the encoding `to` written to `stream`. Calling `close` on the
|
205 |
| -stream is necessary to complete the encoding (but does not close `stream`). |
| 205 | +returned object is necessary to complete the encoding (but it does not close `stream`). |
206 | 206 |
|
207 | 207 | `to` and `from` can be specified either as a string or as an `Encoding` object.
|
208 | 208 | """
|
@@ -404,13 +404,26 @@ function open(fname::AbstractString, enc::Encoding, mode::AbstractString)
|
404 | 404 | end
|
405 | 405 |
|
406 | 406 | """
|
| 407 | + read(stream::IO, [nb::Integer,] enc::Encoding) |
| 408 | + read(filename::AbstractString, [nb::Integer,] enc::Encoding) |
407 | 409 | read(stream::IO, ::Type{String}, enc::Encoding)
|
408 | 410 | read(filename::AbstractString, ::Type{String}, enc::Encoding)
|
409 | 411 |
|
410 |
| -Methods to read text in character encoding `enc`. |
| 412 | +Methods to read text in character encoding `enc`. See documentation for corresponding methods |
| 413 | +without the `enc` argument for details. |
411 | 414 | """
|
412 |
| -Base.read(s::IO, ::Type{String}, enc::Encoding) = read(StringDecoder(s, enc), String) |
413 |
| -Base.read(filename::AbstractString, ::Type{String}, enc::Encoding) = open(io->read(io, String, enc), filename) |
| 415 | +Base.read(s::IO, enc::Encoding) = |
| 416 | + read(StringDecoder(s, enc)) |
| 417 | +Base.read(filename::AbstractString, enc::Encoding) = |
| 418 | + open(io->read(io, enc), filename) |
| 419 | +Base.read(s::IO, nb::Integer, enc::Encoding) = |
| 420 | + read(StringDecoder(s, enc), nb) |
| 421 | +Base.read(filename::AbstractString, nb::Integer, enc::Encoding) = |
| 422 | + open(io->read(io, nb, enc), filename) |
| 423 | +Base.read(s::IO, ::Type{String}, enc::Encoding) = |
| 424 | + read(StringDecoder(s, enc), String) |
| 425 | +Base.read(filename::AbstractString, ::Type{String}, enc::Encoding) = |
| 426 | + open(io->read(io, String, enc), filename) |
414 | 427 |
|
415 | 428 | """
|
416 | 429 | readline(stream::IO, enc::Encoding; keep::Bool=false)
|
|
0 commit comments