-
Notifications
You must be signed in to change notification settings - Fork 73
R CMD CHECK ERROR on r-devel-linux-x86_64-debian-clang #497
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
Comments
cli does not output the UTF-8 characters if the locale is not UTF-8. So one fix is to call |
Thanks for the prompt answer :-) I am not sure I fully understand. My use case is cli::cat_bullet(bullet = "info") So do think the best ways to handle this situation is to replace this code with something like this? if (cli::is_utf8_output()) {
cli::cat_bullet(bullet = "info")
} else {
cat("[info]") # or any other ASCII character that looks similar to the info bullet?
} We could put that functionality in a wrapper for easy re-use within styler. |
No, you only need to change the tests. cli automatically changes the output if there is no UTF-8 support. You just need to change the test strings you compare against. |
❯ cli::symbol$bullet
[1] "●"
❯ withr::with_options(list(cli.unicode = FALSE), cli::symbol$bullet)
[1] "*" |
Ok, now with the example I think I get it: I just make sure the reference value in the test is depending on whether or not UTF-8 is available, right? |
Right. |
I appreciate your help Gabor. Thanks. |
NP. Note that you can test this on R-hub before you submit. ❯ rhub::platforms()
debian-clang-devel:
Debian Linux, R-devel, clang, ISO-8859-15 locale.
... |
Yes I saw that on twitter. Will definitively make use of it 👍 . |
Uh oh!
There was an error while loading. Please reload this page.
Most likely due to the charset changed from UTF-8 to ISO8859-15 and special characters printed with the cli packge, which does not fail on the aforementioned flavor.
Seems to appear in other repos also, e.g. pillar and was discussed on r-devel, but I don't know which conclusions to draw from it. One potential fix is to skip tests on CRAN if the encoding is not UTF8, but this seems not an ideal solution. It was done here for example.
This is how the output of styler looks in case things are going well:

I don't know how to fix this. We are required to submit a new version of styler to CRAN for other reasons, namely #490, until May 10, so I thought we could fix this as well until then (if we knew how).
cc: @krlmlr, @gaborcsardi, @davidgohel.
The text was updated successfully, but these errors were encountered: