Rev 32657 | Blame | Last modification | View Log | Download | RSS feed
## from iconv.Rd(x <- "fa\xE7ile")charToRaw(xx <- iconv(x, "latin1", "UTF-8"))iconv(x, "latin1", "ASCII") # NAiconv(x, "latin1", "ASCII", "?") # "fa?ile"iconv(x, "latin1", "ASCII", "") # "faile"iconv(x, "latin1", "ASCII", "byte") # "fa<e7>ile"# Extracts from R help files(x <- c("Ekstr\xf8m", "J\xf6reskog", "bi\xdfchen Z\xfcrcher"))iconv(x, "latin1", "ASCII//TRANSLIT")iconv(x, "latin1", "ASCII", sub="byte")## tests of re-encoding in .Crequire("tools")x <- "fa\xE7ile".C("Renctest", x, PACKAGE="tools")[[1]].C("Renctest", x, PACKAGE="tools", ENCODING="latin1")[[1]]xx <- iconv(x, "latin1", "UTF-8").C("Renctest", xx, PACKAGE="tools", ENCODING="UTF-8")[[1]]## tests of match length in delimMatchx <- c("a{bc}d", "{a\xE7b}")delimMatch(x)xx <- iconv(x, "latin1", "UTF-8")delimMatch(xx) ## 5 6 in latin1, 5 5 in UTF-8