Problem when using ASCII characters in R code #659
-
Hi, Since I would like to publish the app in German, my dataset contains variables that in turn contain Umlaute such as Ä, Ö, Ü, ä, ö, and ü (which all show up in both app_ui.R and mod_dataviz.R). @ColinFay : Despite having specified UTF-8 in the global options, do I have to fix the warning concerning these non-ASCII characters by replacing Ä, Ö, Ü, ä, ö, and ü in whatever way by \u00c4, \u00d6, \u00dc, \u00e4, \u00f6, and \u00fc respectively? Note that replacing "RO-1: Ohne \nRückerstattung" by "RO-1: Ohne \nR"\u00fcckerstattung" in mod_dataviz.R solves the first warning regarding mod_dataviz.R but renders the following additional warning: Could replacing every Ä, Ö, Ü, ä, ö, and ü in app_ui.R and mod_dataviz.R work if instead done in the following fashion(?): Note that I actually do not want to sent the app/package to CRAN or to another package manager later on - I only want to deploy it e.g. via shinyapps.io or rstudioconnect. However, I do not know whether this warning is still a problem for this deploy-process. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey, Yes, this is a known issue when it comes to publishing to the CRAN, which requires ASCII character only. There are two solutions to this issue here:
> stringi::stri_escape_unicode("Lélàô ")
[1] "L\\u00e9l\\u00e0\\u00f4 " Note that the
See also this chapter for more information https://r-pkgs.org/r.html#code-cran Cheers, |
Beta Was this translation helpful? Give feedback.
Hey,
Yes, this is a known issue when it comes to publishing to the CRAN, which requires ASCII character only.
AFAIK, this is a legacy requirement, and almost every computer and server that would run this app will support non ASCII characters.
There are two solutions to this issue here:
Note that the
{prefixer}
package can do that for you too https://github.com/dreamRs/prefixer/#not-ascii