-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Milestone
Description
library(magrittr)
suppressPackageStartupMessages(library(dplyr))
data_frame(a = 1) %>%
setNames(enc2native("\u4e2d")) %>%
mutate_all(funs(as.character))
#> # A tibble: 1 x 2
#> `<U+4E2D>` `中`
#> <dbl> <chr>
#> 1 1 1
data_frame(a = 1) %>%
setNames("\u4e2d") %>%
mutate_all(funs(as.character))
#> Warning: Mangling the following names: <U+4E2D> -> <U+4E2D>. Use
#> enc2native() to avoid the warning.
#> Error in mutate_impl(.data, dots): Evaluation error: variable '<U+4E2D>' not found.(I did manually change the output for the first example to include the Chinese character.)
In the first example, mutate_all() gets a data frame with Unicode-escaped column names at input. Do we want to repair encoding in column names for each dplyr verb?
In the second example, the column name is properly UTF-8 encoded, but r-lib/rlang@ff87439 seems to get confused.
CC @lionel-.
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior