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

Unicode errors on GH actions Ubuntu-latest (devel) #150

Closed
mikeroswell opened this issue Dec 5, 2023 · 10 comments
Closed

Unicode errors on GH actions Ubuntu-latest (devel) #150

mikeroswell opened this issue Dec 5, 2023 · 10 comments

Comments

@mikeroswell
Copy link

mikeroswell commented Dec 5, 2023

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
  
)
@thomasp85
Copy link
Member

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

@thomasp85
Copy link
Member

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

@mcanouil
Copy link

mcanouil commented Apr 25, 2024

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)

@thomasp85
Copy link
Member

Thanks for the reprex @mcanouil

@mcanouil
Copy link

mcanouil commented Apr 26, 2024

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

@thomasp85
Copy link
Member

AFAIR, they are aware of this

@mcanouil
Copy link

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.

@thomasp85
Copy link
Member

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

@pmur002
Copy link
Contributor

pmur002 commented May 3, 2024

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

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

No branches or pull requests

4 participants