Skip to content

Commit 76ec862

Browse files
authored
Two more fixes for non-UTF-8 tests (#7681)
* Windows path tests: skip if not representable Not all ANSI encodings can represent accented Latin characters. For non-representable strings, enc2native() may substitute a different character (observed: "o" instead of "o with an umlaut), which fails a later comparison of the file name with the original, non-converted string. * Drop native encoding requirement Test 1164.1 should pass with UTF-8 encoded strings without converting them to the native encoding.
1 parent 2537862 commit 76ec862

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

inst/tests/tests.Rraw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4249,7 +4249,7 @@ test(1163, last(x), character(0))
42494249
# Bug fix for #5159 - chmatch and character encoding (for some reason this seems to pass the test on a mac as well)
42504250
a = c("a","\u00E4","\u00DF","z")
42514251
au = iconv(a,"UTF8","latin1")
4252-
test(1164.1, requires_utf8=c("\u00E4", "\u00DF"), chmatch(a, au), match(a, au))
4252+
test(1164.1, chmatch(a, au), match(a, au))
42534253

42544254
# Bug fix for #73 - segfault when rbindlist on empty data.tables
42554255
x <- as.data.table(BOD)
@@ -13512,7 +13512,7 @@ alloc.col(ans)
1351213512
test(1965.3, setDT(list(1:2, M)), ans, warning='Some columns are a multi-column type.*for example column 2')
1351313513

1351413514
# fread/fwrite file name in native and utf-8 encoding, #3078
13515-
if (.Platform$OS.type=="windows") {
13515+
if (.Platform$OS.type=="windows" && utf8_check("\u00c3\u00b6\u00fc")) {
1351613516
f = tempfile("\u00f6"); cat("3.14", file = f)
1351713517
fn = enc2native(f); f8 = enc2utf8(f)
1351813518
test(1966.1, fread(fn), data.table(V1=3.14))

0 commit comments

Comments
 (0)