Learn R Programming

ctypesio (version 0.1.2)

write_utf8: Write UTF8 string

Description

write_utf8_raw() writes the string without a nul-terminator. write_utf8() includes a nul-terminator

Usage

write_utf8(con, x)

write_utf8_raw(con, x)

Value

If con is a connection then this connection is returned invisibly. If con is a raw vector then new data is appended to this vector

Arguments

con

Connection object or raw vector. When con is a raw vector, new data will be appended to the vector and returned. Connection objects can be created with file(), url(), rawConnection() or any of the other many connection creation functions.

x

single character string

See Also

Other data output functions: fprintf(), write_f64(), write_hex(), write_raw(), write_uint8()

Examples

Run this code
con <- file(tempfile(), "wb")
write_utf8(con, "hello")
close(con)

Run the code above in your browser using DataLab