Skip to content

Commit 9fb90d4

Browse files
Mention possible limitations of strtrim approach (#6743)
* Mention possible limitations of strtrim approach * mention in NEWS
1 parent bfccc23 commit 9fb90d4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ rowwiseDT(
181181
+ Using `droplevels(in.place=TRUE)` (warning since v1.16.0) has been upgraded from warning to error. The argument will be removed in the next release.
182182
+ Use of `:=` and `with=FALSE` in `[` has been upgraded from warning (since v1.15.0) to error. Long ago (before 2014), this was needed when, e.g., assigning to a vector of column names defined outside the table, but `with=FALSE` is no longer needed to do so: `DT[, (cols) := ...]` works fine.
183183

184+
11. Better handling of multibyte characters in `print()`, added in 1.16.0, has the side effect of possibly ignoring invisible characters like `\n` or `\t` for the purposes of counting width for `datatable.prettyprint.char`. That's because we switched to using `strtrim()` over `substring()`, the latter of which is explicitly discouraged for the purposes of truncating strings, whereas the former of which has platform-dependent behavior for whether invisible characters count towards string width.
185+
184186
# data.table [v1.16.4](https://github.com/Rdatatable/data.table/milestone/36) 4 December 2024
185187
186188
## BUG FIXES

man/print.data.table.Rd

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
\code{format_col} and \code{format_list_item} generics provide flexibility for end-users to define custom printing methods for generic classes.
1616

17-
Note also the option \code{datatable.prettyprint.char}; character columns entries exceeding this limit will be truncated, with \code{...} indicating the truncation.
18-
}
17+
Note also the option \code{datatable.prettyprint.char}; character columns entries exceeding this limit will be truncated, with \code{...} indicating the truncation. Note that the truncation is done with \code{\link{strtrim}}; be cognizant of potential limitations when dealing with non-printable characters like newlines or tabs. }
1918
\usage{
2019
\method{print}{data.table}(x,
2120
topn=getOption("datatable.print.topn"), # default: 5

0 commit comments

Comments
 (0)