Skip to content
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

Support UTF-8 content in local_tempfile(lines = ) #210

Closed
MichaelChirico opened this issue Oct 8, 2022 · 2 comments · Fixed by #246
Closed

Support UTF-8 content in local_tempfile(lines = ) #210

MichaelChirico opened this issue Oct 8, 2022 · 2 comments · Fixed by #246

Comments

@MichaelChirico
Copy link
Contributor

We have some code in our test suite that is ripe for replacement by withr::local_tempfile()'s lines= argument, but it needs to support UTF-8 as we test some encoding stuff in that suite:

https://github.com/r-lib/lintr/blob/ccc1e7456f174a91d43744d1ca40252268796db6/tests/testthat/test-get_source_expressions.R#L1-L5

Would the approach there (write to a connection with encoding declared) be more suitable for use in {withr}?

Happy to file a PR.

@hadley
Copy link
Member

hadley commented Feb 9, 2023

Yeah, and we should possibly use mode = "wb" to consistently write the same data on windows and linux/mac.

@MLopez-Ibanez
Copy link
Contributor

Same as #216 ?

hadley added a commit that referenced this issue Jan 9, 2024
@hadley hadley closed this as completed in 5546f00 Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants