Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 28 lines (23 sloc) 0.863 kb
c5ab6aa add ENCODING= arg to .C
ripley authored
1 ## from iconv.Rd
2 (x <- "fa\xE7ile")
3 charToRaw(xx <- iconv(x, "latin1", "UTF-8"))
4
5 iconv(x, "latin1", "ASCII") # NA
6 iconv(x, "latin1", "ASCII", "?") # "fa?ile"
7 iconv(x, "latin1", "ASCII", "") # "faile"
8 iconv(x, "latin1", "ASCII", "byte") # "fa<e7>ile"
9
10 # Extracts from R help files
11 (x <- c("Ekstr\xf8m", "J\xf6reskog", "bi\xdfchen Z\xfcrcher"))
12 iconv(x, "latin1", "ASCII//TRANSLIT")
13 iconv(x, "latin1", "ASCII", sub="byte")
14
15 ## tests of re-encoding in .C
16 require("tools")
17 x <- "fa\xE7ile"
18 .C("Renctest", x, PACKAGE="tools")[[1]]
19 .C("Renctest", x, PACKAGE="tools", ENCODING="latin1")[[1]]
20 xx <- iconv(x, "latin1", "UTF-8")
21 .C("Renctest", xx, PACKAGE="tools", ENCODING="UTF-8")[[1]]
b94d743 have used on ICONV_LATIN1
ripley authored
22
23 ## tests of match length in delimMatch
24 x <- c("a{bc}d", "{a\xE7b}")
25 delimMatch(x)
26 xx <- iconv(x, "latin1", "UTF-8")
27 delimMatch(xx) ## 5 6 in latin1, 5 5 in UTF-8
Something went wrong with that request. Please try again.