ragg icon indicating copy to clipboard operation
ragg copied to clipboard

Unicode errors on GH actions Ubuntu-latest (devel)

Open mikeroswell opened this issue 6 months ago • 3 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
  
)

mikeroswell avatar Dec 05 '23 16:12 mikeroswell

I'm pretty sure these are from the pdf device in the devel branch - can you point me to the CI log?

thomasp85 avatar Dec 06 '23 09:12 thomasp85

@thomasp85 https://github.com/mikeroswell/MeanRarity/actions/runs/7103091997/job/19334959441

mikeroswell avatar Dec 06 '23 20:12 mikeroswell

Sorry for not coming back to this. Do you still see the issue with the latest R devel?

thomasp85 avatar Mar 13 '24 08:03 thomasp85

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")

image

Or directly using grid:

library(grid)
grid.newpage()
grid.text("\u221E", x = 0.5, y = 0.5)

mcanouil avatar Apr 25 '24 16:04 mcanouil

Thanks for the reprex @mcanouil

thomasp85 avatar Apr 25 '24 18:04 thomasp85

@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)

mcanouil avatar Apr 26 '24 09:04 mcanouil

AFAIR, they are aware of this

thomasp85 avatar Apr 26 '24 09:04 thomasp85

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.

mcanouil avatar Apr 26 '24 09:04 mcanouil

Hmm... @pmur002 do you know the state of this bug?

thomasp85 avatar Apr 26 '24 09:04 thomasp85

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).

pmur002 avatar May 03 '24 00:05 pmur002