R: Check the validity of a byte stream ot be interpreted as...

checkUTF8 {base64enc} | R Documentation

## Check the validity of a byte stream ot be interpreted as UTF8.

### Description

`checkUTF8` check whether a given raw vector can be used as a valid string encoded in UTF8.

### Usage

    checkUTF8(what, quiet = FALSE,	charlen = FALSE, min.char = 1L)

### Arguments

`what` | raw vector with the payload
`quiet` | logical, if `TRUE` then the function will not fail but report success/failure via its result, otherwise failures are considered errors.
`charlen` | logical, if `TRUE` then the function returns the length of the longest byte sequence representing a character in the file.
`min.char` | integer, any bytes below this value are considered control chacters and reported as errors. The default value of 1L guards against strings including NULs.

### Value

If `charlen=FALSE`: `TRUE` on success, `FALSE` if the payload is invalid and `quite=TRUE`.

If `charlen=TRUE`: positive integer corresponding to the longest encoded sequence on success, negative integer on failure.

### Author(s)

Simon Urbanek

[Package base64enc version 0.1-3 Index]