We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7e451b2 + ae4ca88 commit 3de7946Copy full SHA for 3de7946
DESCRIPTION
@@ -66,3 +66,5 @@ Collate:
66
'vertical.R'
67
'visit.R'
68
'zzz.R'
69
+Remotes:
70
+ krlmlr/enc
tests/testthat/test-encoding.R
@@ -0,0 +1,21 @@
1
+context("non-ASCII characters are handled properly")
2
+
3
+test_that("non-ASCII characters are handled properly", {
4
+ skip_if(.Platform$OS.type != "windows")
5
6
+ withr::with_locale(
7
+ c(LC_CTYPE = "English_United States.1252"),
8
+ {
9
+ tmp <- tempfile(fileext = ".R")
10
+ con <- file(tmp, encoding = "UTF-8")
11
+ on.exit(close(con), add = TRUE)
12
13
+ # c.f. dplyr's tests/testthat/helper-encoding.R
14
+ writeLines("Gl\u00fcck+1", con)
15
16
+ style_file(tmp)
17
+ result <- readLines(con)
18
+ expect_equal(result, "Gl\u00fcck + 1")
19
+ }
20
+ )
21
+})
0 commit comments