diff --git a/R/character-helpers.R b/R/character-helpers.R index fe82b4cb..8261bda2 100644 --- a/R/character-helpers.R +++ b/R/character-helpers.R @@ -152,7 +152,7 @@ repair_encoding <- function(code, string_is_ascii, encoding) { if (no_repair_needed) return(code) .cstr_pipe( code, - sprintf("(`Encoding<-`)(\"%s\")", encoding), + sprintf("`Encoding<-`(\"%s\")", encoding), one_liner = TRUE ) } diff --git a/tests/testthat/_snaps/encoding.md b/tests/testthat/_snaps/encoding.md index fb345a4a..9694e77e 100644 --- a/tests/testthat/_snaps/encoding.md +++ b/tests/testthat/_snaps/encoding.md @@ -15,7 +15,7 @@ x <- iconv("hello world", to = "latin1") construct(x) Output - "hello\xa0world" |> (`Encoding<-`)("latin1") + "hello\xa0world" |> `Encoding<-`("latin1") Code x <- iconv("こんにちは", to = "shift_jis") construct(x) @@ -26,5 +26,5 @@ Encoding(x) <- "latin1" construct(x) Output - "hello\xa0world" |> (`Encoding<-`)("latin1") + "hello\xa0world" |> `Encoding<-`("latin1")