convert_encoding_linux <- function(from.file, to.file, from.encoding, to.encoding="UTF-8", ignore_errors=TRUE, intern=FALSE, verbose=TRUE) {
## Uses the linux function iconv to convert a file from one encoding to another
## Output is to a new, second, file -- it does not overwrite the original file

  ## iconv -f WINDOWS-1252 -t UTF-8//IGNORE ~rsaporta/git/orch/ingest/PerformanceRights/abramus/'abramus 20160414 - ioda_arq1_2_3_4.csv'|cat > ~rsaporta/git/orch/ingest/PerformanceRights/abramus/abramus_utf8.csv
  cmd <- sprintf("iconv -f %s -t %s%s %s | cat > %s"
    , from.encoding, to.encoding, ifelse(ignore_errors, "//IGNORE", ""), shellClean(from.file), shellClean(to.file)
    )

  verboseMsg(verbose, "Running the following convert command:\n\t", cmd, time=FALSE)

  system(cmd, intern=intern)
}
