Learn R Programming

stylo (version 0.7.5)

change.encoding: Change character encoding

Description

This function is a wrapper around iconv() that allows for converting character encoding of multiple text files in a corpus folder, preferably into UTF-8.

Usage

change.encoding(corpus.dir = "corpus/", from, to = "utf-8", 
                keep.original = TRUE, output.dir = NULL)

Value

The function saves reencoded text files.

Arguments

corpus.dir

path to the folder containing the corpus.

from

original character encoding. See the Details section (below) for some hints on how to get the original encoding.

to

character encoding to convert into.

keep.original

shall the original files be stored?

output.dir

folder for the reencoded files.

Author

Steffen Pielström

Details

Stylo works on UTF-8-enconded texts by default. This function allows you to convert your corpus, if not yet encoded in UTF-8. To check the current encoding of text files in your corpus folder, you can use the function check.encoding().

See Also

check.encoding