| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d24370b commit a80cd2f
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,6 +72,8 @@ | |||
| 72 | 72 | ||
| 73 | 73 | 16. `copy()` is now more consistent about reallocating nested `data.table`s, [#7456](https://github.com/Rdatatable/data.table/issues/7456). The resulting list is now only overwritten when necessary, list columns inside data.tables are searched recursively, and their attributes are walked in search of data.tables to reallocate as well. Thanks to @be-marc for the report, @david-cortes for additional information, and @aitap for the fix. | |
| 74 | 74 | ||
| 75 | + 17. `print()` works with multi-byte characters on R before 4.2.0, [#7848](https://github.com/Rdatatable/data.table/pull/7848). Thanks @MichaelChirico for the fix and @aitap for the improvement. | ||
| 76 | + | ||
| 75 | 77 | ### Notes | |
| 76 | 78 | ||
| 77 | 79 | 1. {data.table} now depends on R 3.5.0 (2018). | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -256,11 +256,8 @@ char.trunc = function(x, trunc.char = getOption("datatable.prettyprint.char")) { | |||
| 256 | 256 | if (is.null(trunc.char)) return(x) | |
| 257 | 257 | trunc.char = max(0L, suppressWarnings(as.integer(trunc.char[1L])), na.rm=TRUE) | |
| 258 | 258 | if (!is.character(x) || trunc.char <= 0L) return(x) | |
| 259 | - nchar_width = tryCatch(nchar(x, 'width', allowNA=TRUE), error=identity) | ||
| 260 | - if (inherits(nchar_width, "error")) { # for R<4.2 e.g. 2366.6 print of fread table gives 'invalid multibyte string' | ||
| 261 | - x = encodeString(x) | ||
| 262 | - nchar_width = nchar(x, 'width', allowNA=TRUE) | ||
| 263 | - } | ||
| 259 | + # TODO(R>=4.2.0): we only need the tryCatch() for old bug in allowNA=TRUE, see #7848 | ||
| 260 | + nchar_width = tryCatch(nchar(x, 'width', allowNA=TRUE), error=function(.) NA) | ||
| 264 | 261 | nchar_chars = nchar(x, 'char', allowNA=TRUE) | |
| 265 | 262 | is_full_width = nchar_width > nchar_chars | |
| 266 | 263 | is_full_width[is.na(is_full_width)] = FALSE | |
| Back | FazBrowse Home | New Git URL |
0 commit comments