-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapshot error on Windows (encoding problem) #1574
Comments
I have also encountered this error after the last testthat release. At the time, at wondered if it was related to using brio for reading and writing, so assuming UTF-8. (6666662) There is a place in Lines 44 to 60 in 6666662
testthat:::eval_with_output(print("maëlle"))
#> $val
#> [1] "maëlle"
#>
#> $vis
#> [1] FALSE
#>
#> $out
#> [1] "[1] \"ma<eb>lle\"" With parent commit before brio switch testthat::eval_with_output(print("maëlle"))
#> $val
#> [1] "maëlle"
#>
#> $vis
#> [1] FALSE
#>
#> $out
#> [1] "[1] \"maëlle\""
I know I just observe this tmp <- tempfile()
sink(tmp)
print('ë')
sink()
brio::read_lines(tmp)
#> [1] "[1] \"\xeb\""
unlink(tmp)
tmp <- tempfile()
con <- file(tmp, encoding = "UTF-8")
sink(con)
print('ë')
sink()
brio::read_lines(tmp)
#> [1] "[1] \"ë\""
unlink(tmp) Anyway, just sharing what I had found when stubbling into this issue as @maelle shared here Windows issue with me. Hope it helps. |
Is this fixed in R4.2? If so, do you need it to work in R4.1 too? (It's likely to be a couple of hours work for me, so I'd prefer to use that time on other things if your motivating issue is resolved by updating R). |
Indeed it now works https://github.com/maelle/encoding.problem/actions/runs/3103119734 |
I fixed this anyway, thanks to @cderv's analysis and a hint from Kurt Hornik. |
In this reprex package https://github.com/maelle/encoding.problem I have a test
I created the snapshot on Ubuntu. On Windows the test fails https://github.com/maelle/encoding.problem/actions/runs/1845617963
With error
Which comes from
indent_add()
and functions it calls.The text was updated successfully, but these errors were encountered: