Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: tags/R-2-10-0
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (23 sloc) 0.863 kb
## from iconv.Rd
(x <- "fa\xE7ile")
charToRaw(xx <- iconv(x, "latin1", "UTF-8"))
iconv(x, "latin1", "ASCII") # NA
iconv(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 .C
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 delimMatch
x <- c("a{bc}d", "{a\xE7b}")
xx <- iconv(x, "latin1", "UTF-8")
delimMatch(xx) ## 5 6 in latin1, 5 5 in UTF-8
Jump to Line
Something went wrong with that request. Please try again.