readers: Read Byte or Character Strings

Description Usage Arguments Details Value See Also

Description

Read byte or character strings from a connection.

Usage

1
2
readBytes(con)
readChars(con, encoding = "")

Arguments

con

a connection object or a character string naming a file.

encoding

encoding to be assumed for input.

Details

Both functions first read the raw bytes from the input connection into a character string. readBytes then sets the Encoding of this to "bytes"; readChars uses iconv to convert from the specified input encoding to UTF-8 (replacing non-convertible bytes by their hex codes).

Value

For readBytes, a character string marked as "bytes". For readChars, a character string marked as "UTF-8" if containing non-ASCII characters.

See Also

Encoding


tau documentation built on July 21, 2021, 5:07 p.m.

Related to readers in tau...