Skip to content

Commit cc01889

Browse files
committed
add info about enc2utf8
1 parent 48e021e commit cc01889

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

R/duplicated.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ duplicated.data.table = function(x, incomparables=FALSE, fromLast=FALSE, by=seq_
1414
} else {
1515
o = forderv(x, by=query$by, sort=FALSE, retGrp=TRUE)
1616
if (isTRUE(as.logical(attr(o, "anynotutf8", exact=TRUE))))
17-
warningf("Mixed encodings detected. Strings were coerced to UTF-8 before duplicated(x).")
17+
warningf("Mixed encodings detected. Strings were coerced to UTF-8 before duplicated(x). Use enc2utf8() to avoid this warning.")
1818
if (attr(o, 'maxgrpn', exact=TRUE) == 1L) return(rep.int(FALSE, nrow(x)))
1919
f = attr(o, "starts", exact=TRUE)
2020
if (fromLast) f = cumsum(uniqlengths(f, nrow(x)))
@@ -34,7 +34,7 @@ unique.data.table = function(x, incomparables=FALSE, fromLast=FALSE, by=seq_alon
3434
if (!length(by)) by = NULL #4594
3535
o = forderv(x, by=by, sort=FALSE, retGrp=TRUE)
3636
if (isTRUE(as.logical(attr(o, "anynotutf8", exact=TRUE)))) {
37-
warningf("Mixed encodings detected. Strings were coerced to UTF-8 before unique(x).")
37+
warningf("Mixed encodings detected. Strings were coerced to UTF-8 before unique(x). Use enc2utf8() to avoid this warning.")
3838
}
3939
if (!is.null(cols)) {
4040
x = .shallow(x, c(by, cols), retain.key=TRUE)

inst/tests/tests.Rraw

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21818,4 +21818,4 @@ b
2181821818
dt = data.table(x=c(iconv("\u00E9","UTF-8","latin1"), "\u00E9"))
2181921819
test(2342.1, unique(dt), data.table(x="\u00E9"), warning="Mixed encodings.*")
2182021820
test(2342.2, duplicated(dt), c(FALSE, TRUE), warning="Mixed encodings.*")
21821-
test(2342.3, unique(dt[c(2L,2L)]), data.table(x="\u00E9"))
21821+
test(2342.3, unique(dt[c(2L,2L)]), data.table(x="\u00E9"))

0 commit comments

Comments
 (0)