Skip to content

Commit 7373a7a

Browse files
Don't assume from="UTF-8" in encoding test (#7852)
* Extend the UTF-8 check for tests 2298* on old Windows * Omit from=UTF-8 to simplify * don't use ' within '-delimited character string
1 parent accac97 commit 7373a7a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

inst/tests/tests.Rraw

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20309,7 +20309,9 @@ local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc"))) {
2030920309
# a-umlaut, o-umlaut, u-umlaut
2031020310
eval(parse(text = ' # eval(parse()) defers parsing to runtime; see utf8_check description
2031120311
setnames(x , c("\u00e4", "\u00f6", "\u00fc"))
20312-
setnames(y , iconv(c("\u00f6", "\u00fc", "\u00e4"), from = "UTF-8", to = "latin1"))
20312+
# NB: since these can be represented e.g. in latin1, after parse(), they will be in
20313+
# native encoding, _not_ necessarily UTF-8, so omit from=
20314+
setnames(y , iconv(c("\u00f6", "\u00fc", "\u00e4"), to = "latin1"))
2031320315
test(2298.1, rbindlist(list(x,y), use.names=TRUE), data.table("\u00e4"=c(1,6), "\u00f6"=c(2,4), "\u00fc"=c(3,5)))
2031420316
test(2298.2, rbindlist(list(y,x), use.names=TRUE), data.table("\u00f6"=c(4,2), "\u00fc"=c(5,3), "\u00e4"=c(6,1)))
2031520317
set(y, j="\u00e4", value=NULL)

0 commit comments

Comments
 (0)