# File encoding detection in R

Posted on October 24, 2017 by Stéphane Laurent
Tags: R

There is a Java port of universalchardet, the encoding detector library of Mozilla. It is called juniversalchardet. I’m going to show how to use it with the rJava package.

Firstly, download the jar file here: https://code.google.com/archive/p/juniversalchardet/downloads. Then, proceed as follows:

library(rJava)
.jinit()
.jcall(detector, "V", "reset")
Nowadays one can achieve the same result with the R package uchardet (which does not use Java).