From 48965148f643d3b5d5d3f35fccc944e07218b289 Mon Sep 17 00:00:00 2001 From: chiricom Date: Tue, 28 Jul 2026 03:33:10 +0000 Subject: [PATCH 1/4] Extend the UTF-8 check for tests 2298* on old Windows --- inst/tests/tests.Rraw | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 915d6f464..80fff1657 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -20302,7 +20302,9 @@ x = data.table(a=1, b=2L) y = data.table(c=1.5, d=1L) test(2297.31, y[x, on=.(c == a, d == a), nomatch=NULL], output="Empty data.table (0 rows and 3 cols): c,d,b") -local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc"))) { +local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc")) && + # TODO(R>=4.2.0): Remove this once UCRT Windows is the default. + !anyNA(eval(parse('iconv(c("\u00f6", "\u00fc", "\u00e4"), from="UTF-8", to="latin1")')))) { # rbindlist(l, use.names=TRUE) should handle different colnames encodings #5452 x = data.table(a = 1, b = 2, c = 3) y = data.table(x = 4, y = 5, z = 6) From f62002c39964781239e2a0719ac743fe7a9e6ce3 Mon Sep 17 00:00:00 2001 From: chiricom Date: Tue, 28 Jul 2026 04:09:38 +0000 Subject: [PATCH 2/4] text= --- inst/tests/tests.Rraw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 80fff1657..8d2168ce2 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -20304,7 +20304,7 @@ test(2297.31, y[x, on=.(c == a, d == a), nomatch=NULL], output="Empty data.table local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc")) && # TODO(R>=4.2.0): Remove this once UCRT Windows is the default. - !anyNA(eval(parse('iconv(c("\u00f6", "\u00fc", "\u00e4"), from="UTF-8", to="latin1")')))) { + !anyNA(eval(parse(text='iconv(c("\u00f6", "\u00fc", "\u00e4"), from="UTF-8", to="latin1")')))) { # rbindlist(l, use.names=TRUE) should handle different colnames encodings #5452 x = data.table(a = 1, b = 2, c = 3) y = data.table(x = 4, y = 5, z = 6) From e1de362f61cfe63e509771456ffc78afaf50f19a Mon Sep 17 00:00:00 2001 From: chiricom Date: Tue, 28 Jul 2026 14:52:07 +0000 Subject: [PATCH 3/4] Omit from=UTF-8 to simplify --- inst/tests/tests.Rraw | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 8d2168ce2..1aab0375e 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -20302,16 +20302,16 @@ x = data.table(a=1, b=2L) y = data.table(c=1.5, d=1L) test(2297.31, y[x, on=.(c == a, d == a), nomatch=NULL], output="Empty data.table (0 rows and 3 cols): c,d,b") -local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc")) && - # TODO(R>=4.2.0): Remove this once UCRT Windows is the default. - !anyNA(eval(parse(text='iconv(c("\u00f6", "\u00fc", "\u00e4"), from="UTF-8", to="latin1")')))) { +local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc"))) { # rbindlist(l, use.names=TRUE) should handle different colnames encodings #5452 x = data.table(a = 1, b = 2, c = 3) y = data.table(x = 4, y = 5, z = 6) # a-umlaut, o-umlaut, u-umlaut eval(parse(text = ' # eval(parse()) defers parsing to runtime; see utf8_check description setnames(x , c("\u00e4", "\u00f6", "\u00fc")) - setnames(y , iconv(c("\u00f6", "\u00fc", "\u00e4"), from = "UTF-8", to = "latin1")) + # NB: since these can be represented e.g. in latin1, after parse(), they'll be in native encoding, _not_ + # necessarily UTF-8, so omit from= + setnames(y , iconv(c("\u00f6", "\u00fc", "\u00e4"), to = "latin1")) test(2298.1, rbindlist(list(x,y), use.names=TRUE), data.table("\u00e4"=c(1,6), "\u00f6"=c(2,4), "\u00fc"=c(3,5))) test(2298.2, rbindlist(list(y,x), use.names=TRUE), data.table("\u00f6"=c(4,2), "\u00fc"=c(5,3), "\u00e4"=c(6,1))) set(y, j="\u00e4", value=NULL) From 8fe37828c2c956d9c38e4b173456be3fa8bee464 Mon Sep 17 00:00:00 2001 From: chiricom Date: Tue, 28 Jul 2026 16:16:41 +0000 Subject: [PATCH 4/4] don't use ' within '-delimited character string --- inst/tests/tests.Rraw | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/tests/tests.Rraw b/inst/tests/tests.Rraw index 1aab0375e..ff82cd25e 100644 --- a/inst/tests/tests.Rraw +++ b/inst/tests/tests.Rraw @@ -20309,8 +20309,8 @@ local(if (utf8_check(c("\u00e4", "\u00f6", "\u00fc"))) { # a-umlaut, o-umlaut, u-umlaut eval(parse(text = ' # eval(parse()) defers parsing to runtime; see utf8_check description setnames(x , c("\u00e4", "\u00f6", "\u00fc")) - # NB: since these can be represented e.g. in latin1, after parse(), they'll be in native encoding, _not_ - # necessarily UTF-8, so omit from= + # NB: since these can be represented e.g. in latin1, after parse(), they will be in + # native encoding, _not_ necessarily UTF-8, so omit from= setnames(y , iconv(c("\u00f6", "\u00fc", "\u00e4"), to = "latin1")) test(2298.1, rbindlist(list(x,y), use.names=TRUE), data.table("\u00e4"=c(1,6), "\u00f6"=c(2,4), "\u00fc"=c(3,5))) test(2298.2, rbindlist(list(y,x), use.names=TRUE), data.table("\u00f6"=c(4,2), "\u00fc"=c(5,3), "\u00e4"=c(6,1)))