detectFileEncoding: detect file encoding for inputted file

Description Usage Arguments Value Examples

View source: R/utils.R

Description

detect file encoding for inputted file

Usage

1
2
  detectFileEncoding(file, n = -1,
    default = getOption("encoding"))

Arguments

file

to read from, or a connection which will be opened if necessary, and if so closed at the end of the function call.

n

integer. The (maximal) number of lines to read. Negative values indicate that one should read up to the end of input on the connection.

default

default encoding if fail to expect.

Value

encoding name

Examples

1
2
3
4
5
6
7
big5encfile <- file.path(system.file(package="Ruchardet"),"tests","big5.txt")
detectFileEncoding(big5encfile)
## Not run: 
detectFileEncoding("http://www.ppomppu.co.kr/")
detectFileEncoding("http://freesearch.pe.kr")

## End(Not run)

haven-jeon/Ruchardet documentation built on May 17, 2019, 3:06 p.m.