-
Notifications
You must be signed in to change notification settings - Fork 235
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 Remapping Causes Function-Documentation Mismatch #1121
Comments
As an addendum, I just tested this on Linux (Ubuntu 18.04), and it the issue does not occur there. This appears to be Windows-specific (or at least present on Windows and absent on Linux). |
My guess is that this is the x <- '"\\u03bc"'
charToRaw(x)
#> [1] 22 5c 75 30 33 62 63 22
y <- deparse(eval(parse(text = x)))
charToRaw(y)
#> [1] 22 b5 22 |
@gaborcsardi Thanks for the quick review. To bidirectionally link the conversations about this issue: https://stat.ethz.ch/pipermail/r-package-devel/2020q3/005822.html |
Reprex: roxygen2::roc_proc_text(roxygen2::rd_roclet(), "
#' Title
#' Desc
fun <- function(x = '\u03bc') { }
")[[1]]
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{fun}
#> \alias{fun}
#> \title{Title
#> Desc}
#> \usage{
#> fun(x = "μ")
#> }
#> \description{
#> Title
#> Desc
#> } Created on 2020-07-23 by the reprex package (v0.3.0) |
Duplicate of #1186 |
This is related to #592.
I am trying to write a Unicode to ASCII simplifier which will map specific characters before doing a general mapping using
stringi
. One of the characters that often shows up in my work is the Greek character lowercase mu. There are two Unicode code points that typically have the same glyph but one is considered "Greek mu" and one is "micro sign". These arec("\u03bc", "\u00b5")
.As I have learned more and more, operating system and locale are often important for this, and so this is on Windows 10 with the English/United States locale (full session info is in the reprex).
When I generated the documentation for these with
devtools::document()
, both of these were mapped to "\u00b5". So, I got an error in Travis-CI:Is there any way to prevent this Unicode remapping?
In the reprex below, the last 4 lines are the problem. They should look like:
Created on 2020-06-21 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: