* using log directory ‘/Users/ripley/R/packages/tests-devel/uchardet.Rcheck’ * using R Under development (unstable) (2023-10-26 r85414) * using platform: aarch64-apple-darwin23.1.0 * R was compiled by Apple clang version 15.0.0 (clang-1500.1.0.1.1) GNU Fortran (GCC) 12.2.0 * running under: macOS Sonoma 14.1 * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘uchardet/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘uchardet’ version ‘1.1.1’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘uchardet’ can be installed ... OK * used C++ compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.1.1)’ * used SDK: ‘MacOSX14.0.sdk’ * checking C++ specification ... NOTE Specified C++11: please drop specification unless essential * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking line endings in Makefiles ... OK * checking compilation flags in Makevars ... OK * checking for GNU extensions in Makefiles ... NOTE GNU make is a SystemRequirements. * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking use of PKG_*FLAGS in Makefiles ... OK * checking pragmas in C/C++ headers and code ... OK * checking compilation flags used ... OK * checking compiled code ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... ERROR Running examples in ‘uchardet-Ex.R’ failed The error most likely occurred in: > ### Name: detect_file_enc > ### Title: File encoding detection > ### Aliases: detect_file_enc > > ### ** Examples > > # detect character vector with ASCII strings > ascii <- "I can eat glass and it doesn't hurt me." > detect_str_enc(ascii) [1] "ASCII" > > # detect character vector with UTF-8 strings > utf8 <- "\u4e0b\u5348\u597d" > print(utf8) [1] "下午好" > detect_str_enc(utf8) [1] "UTF-8" > > # function to read ASCII or UTF-8 files > read_file <- function(x) readChar(x, file.size(x)) > # path to examples > ex_path <- system.file("examples", package = "uchardet") > > # russian text > ru_utf8 <- read_file(file.path(ex_path, "ru.txt")) > print(ru_utf8) [1] "Я могу есть стекло, оно мне не вредит.\n" > detect_str_enc(iconv(ru_utf8, "utf8", "ibm866")) [1] "IBM866" > detect_str_enc(iconv(ru_utf8, "utf8", "koi8-r")) [1] "KOI8-R" > detect_str_enc(iconv(ru_utf8, "utf8", "cp1251")) [1] "WINDOWS-1251" > > # china text > zh_utf8 <- read_file(file.path(ex_path, "zh.txt")) > print(zh_utf8) [1] "我能吞下玻璃而不傷身體。\n" > detect_str_enc(iconv(zh_utf8, "utf8", "big5")) [1] "BIG5" > detect_str_enc(iconv(zh_utf8, "utf8", "gb18030")) [1] "GB18030" > > # korean text > ko_utf8 <- read_file(file.path(ex_path, "ko.txt")) > print(ko_utf8) [1] "나는 유리를 먹을 수 있어요. 그래도 아프지 않아요\n" > detect_str_enc(iconv(ko_utf8, "utf8", "uhc")) [1] "UHC" > detect_str_enc(iconv(ko_utf8, "utf8", "iso-2022-kr")) Error in iconv(ko_utf8, "utf8", "iso-2022-kr") : could not allocate memory (4095 Mb) in C function 'R_AllocStringBuffer' Calls: detect_str_enc -> iconv Execution halted * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘tinytest.R’ ERROR Running the tests in ‘tests/tinytest.R’ failed. Complete output: > if (requireNamespace("tinytest", quietly = TRUE)) { + # set a seed to make the test deterministic + set.seed(42) + + # run tests (package must be installed) + tinytest::test_package("uchardet") + } test-detect-file.R............ 0 tests test-detect-file.R............ 1 tests OK test-detect-file.R............ 2 tests OK test-detect-file.R............ 3 tests OK test-detect-file.R............ 4 tests OK test-detect-file.R............ 5 tests OK test-detect-file.R............ 6 tests OK test-detect-file.R............ 7 tests OK test-detect-file.R............ 8 tests OK test-detect-file.R............ 8 tests OK test-detect-file.R............ 8 tests OK test-detect-file.R............ 8 tests OK test-detect-file.R............ 9 tests OK test-detect-file.R............ 9 tests OK test-detect-file.R............ 9 tests OK test-detect-file.R............ 9 tests OK test-detect-file.R............ 10 tests OK test-detect-file.R............ 11 tests OK test-detect-file.R............ 12 tests OK test-detect-file.R............ 13 tests OK 38ms test-detect-raw.R............. 0 tests test-detect-raw.R............. 1 tests OK test-detect-raw.R............. 2 tests OK test-detect-raw.R............. 3 tests OK test-detect-raw.R............. 4 tests OK test-detect-raw.R............. 5 tests OK test-detect-raw.R............. 6 tests OK test-detect-raw.R............. 7 tests OK test-detect-raw.R............. 8 tests OK test-detect-raw.R............. 9 tests OK test-detect-raw.R............. 9 tests OK test-detect-raw.R............. 10 tests OK test-detect-raw.R............. 10 tests OK test-detect-raw.R............. 11 tests OK test-detect-raw.R............. 11 tests OK test-detect-raw.R............. 12 tests OK test-detect-raw.R............. 12 tests OK test-detect-raw.R............. 128 tests OK 27ms test-detect-str.R............. 0 tests test-detect-str.R............. 1 tests OK test-detect-str.R............. 2 tests OK test-detect-str.R............. 3 tests OK test-detect-str.R............. 4 tests OK test-detect-str.R............. 5 tests OK test-detect-str.R............. 5 tests OK test-detect-str.R............. 6 tests OK test-detect-str.R............. 7 tests OK test-detect-str.R............. 8 tests OK test-detect-str.R............. 8 tests OK test-detect-str.R............. 9 tests OK test-detect-str.R............. 9 tests OK test-detect-str.R............. 10 tests OK test-detect-str.R............. 10 tests OK Error in iconv(res, "UTF-8", enc) : could not allocate memory (4095 Mb) in C function 'R_AllocStringBuffer' Calls: ... attr.all.equal -> mode -> detect_str_enc -> read_utf8 -> iconv In addition: Warning messages: 1: In detect_file_enc("") : Can not open file ''. 2: In detect_file_enc("no-exists") : Can not open file 'no-exists'. Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking re-building of vignette outputs ... OK * checking PDF version of manual ... OK * checking HTML version of manual ... OK * checking for detritus in the temp directory ... OK * DONE Status: 2 ERRORs, 2 NOTEs See ‘/Users/ripley/R/packages/tests-devel/uchardet.Rcheck/00check.log’ for details. 14.75 real 9.79 user 3.70 sys