Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Should be able to supply encoding #40
It would be an argument to a function. Detecting encoding automatically is difficult - the stringi package has some code using ICU (see bottom of http://docs.rexamine.com/stringi/compat_tab_conversion.html)
Actually, there is no automatic conversion to UTF-8. I think we could automatically detect the encoding of a file using the chardet command line.
It seems to work pretty well. The fileEncoding option would still be useful to me.
This was referenced
Jul 5, 2015
The interface will probably get nicer, but this now works :)
x <- c("こんにちは") x #>  "こんにちは" Encoding(x) #>  "UTF-8" y <- iconv(x, "UTF-8", "shift-jis") y #>  "\x82\xb1\x82\xf1\x82\u0242\xbf\x82\xcd" Encoding(y) #>  "unknown" ja <- locale("ja", encoding = "shift-jis") z <- parse_character(y, locale = ja) z #>  "こんにちは" Encoding(z) #>  "UTF-8"