peek_iconv: Converts encoding of characters

Description Usage Arguments Examples

View source: R/funs.R

Description

Read a file, convert the encoding of characters and print the result.

Usage

1
peek_iconv(path, from, to = "UTF-8", newfile = NULL)

Arguments

path

file path

from

the code set in which the input is encoded.

to

the code set to which the output is to be converted.

newfile

result file. Default to NULL. If null the result will be print in the R console, otherwise a file is produced containing the result.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
la_cigale <- system.file(package = "fpeek", "datafiles",
  "cigfou-ISO-8859-1.txt")

peek_head(la_cigale)
peek_iconv(la_cigale, from = "ISO-8859-1", to = "UTF-8")

newfile <- tempfile()
peek_iconv(la_cigale, from = "ISO-8859-1", to = "UTF-8",
  newfile = newfile)
peek_head(newfile, n = 10)

fpeek documentation built on July 23, 2018, 1:02 a.m.