Ruchardet (version 0.0-3.1)

detectFileEncoding: detect file encoding for inputted file

Description

detect file encoding for inputted file

Usage

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

Run this code
# NOT RUN {
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")
# }

Run the code above in your browser using DataCamp Workspace