Unicode errors on GH actions Ubuntu-latest (devel)
Closed this issue · 10 comments
I am getting the following error when running CI on an R package:
Error in grid.Call.graphics(C_text, as.graphicsAnnot(x$label), x$x, x$y, :
conversion failure on 'ℓ = 0' in 'mbcsToSbcs': for ℓ (U+2113)
Calls: <Anonymous> ... drawDetails -> drawDetails.text -> grid.Call.graphics
I don't know if this is something ragg should handle, but the offending vignette includes
```{r, setup, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE
, comment = "#>"
, dev = "ragg_png"
, dpi = 150
)
I'm pretty sure these are from the pdf device in the devel branch - can you point me to the CI log?
Sorry for not coming back to this. Do you still see the issue with the latest R devel?
FYI, it's super easy to reproduce using R 4.4.0 and it is unrelated to ragg
.
Opening R in a terminal without external graphic device (thus the PDF device):
library(ggplot2)
ggplot() + geom_blank() + labs(title = "\u221E")
Or directly using grid
:
library(grid)
grid.newpage()
grid.text("\u221E", x = 0.5, y = 0.5)
@thomasp85 Do you think, it is worth reporting upstream? (https://bugs.r-project.org/)
(This causes examples of R packages using unicode to fail during R CMD Check)
AFAIR, they are aware of this
I thought so, the weird part is that this issue was there before 4.4.0 but R CMD Check only fails for 4.4.0.
I believe the rationale is this: trying to draw UNICODE text that does not iconv()
to Latin1 on a pdf()
(or postscript()
) device (or to whatever the encoding is on the device) is a mistake and the "improvement" is that R CMD check now reports this "error". So the advice is to "fix" the package so that it no longer makes this mistake. I hope that makes sense (independent of whether it is agreeable).