fixEncoding: Fix Encoding Problems

View source: R/fixEncoding.R

fixEncodingR Documentation

Fix Encoding Problems

Description

Simple function to replace typical encoding problems when importing text with accents or special characters which is not in UTF-8 (i.e. latin1 encoding).

Usage

fixEncoding(x, encoding = NULL)

Arguments

x

a vector with characters to be replaced

encoding

a character containing the encoding used to mark the output vector

Details

The function makes no encoding guessing. It just directly replaces common enconding problems from text in latin1 to UTF-8 characters. So, make sure that this replacement makes sure to your data.

Value

the input vector with the encoding problems replaced

Author(s)

Renato A. F. de Lima

Examples

  nomes <- c("José", "Gonçalves", "Müller", "Londoño")

## Not run: 
  fixEncoding(nomes)
  fixEncoding(nomes, encoding = "UTF-8")
  fixEncoding(nomes, encoding = "latin1")


## End(Not run)


LimaRAF/plantR documentation built on Jan. 1, 2023, 10:18 a.m.