-
-
Notifications
You must be signed in to change notification settings - Fork 873
-
-
Notifications
You must be signed in to change notification settings - Fork 873
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
Caching does not work with R-devel when cache path contains special characters (R-4.0.0) #1840
Comments
Since the same thing worked with R 3.6.3 but not 4.0, it is most likely to be an issue with R 4.0 instead of knitr (there were some NEWS items about |
By R 3.6, which exact version did you mean? I tested 3.6.3 and 4.0.1, and your example failed with both versions of R. |
Thank you for investigating. Now, it also works for me. Such encoding issues are tedious to debug. The version of RStudio might also play a role (so it might also have been an RStudio-bug). So I will close. Thank you again! |
Sorry, I was too quick. It still does not work with RStudio 1.3.959 with R-4.0.0, neither if I let RStudio knit nor if I run the knit command in the console. I also checked the "current language for non-Unicode programs"-setting, and it is German. So I reopen (but I completely understand if you do not find the time to investigate). I might try to debug myself to see where the problematic conversion happens. I also tried |
I reported this issue to R core: https://stat.ethz.ch/pipermail/r-devel/2020-June/079694.html As I mentioned above, later I found that the problem was not reproducible with the German locale. Could you run the code below and report the output? owd = setwd(tempdir())
z = 'K\u00e4sch.txt'
file.create(z)
list.files()
file.exists(list.files())
setwd(owd) |
That seems to work: > owd = setwd(tempdir())
> z = 'K\u00e4sch.txt'
> file.create(z) [1] TRUE
> list.files()
[1] "Käsch.txt"
[2] "rs-graphics-7b97ca4d-12fd-4cdc-a629-fb0f754d3c9d"
> file.exists(list.files())
[1] TRUE TRUE
> setwd(owd) Note that in my case, the non-ASCII-character is in the directory name, not the file name. |
I figured out some more things:
So, in any case it is not a knitr-problem, I presume. |
For the record, I'm comparing R-3.6.3 and R-4.0.0. I cannot try R-4.0.1 or R-4.0.2 right now. |
Got it: > p <- "Föö/Bär"
> Encoding(p)
[1] "latin1"
> Encoding(dirname(p))
[1] "UTF-8"
> Encoding(basename(p))
[1] "UTF-8" Should that happen? |
To sum up, I guess that there are two problems:
|
With R-4.0.2, everything works again. Thanks again for your help. |
I saw your report at https://stat.ethz.ch/pipermail/r-devel/2020-June/079732.html but didn't read it. Anyway, it's good to know the problem has been fixed in the latest version of R (and again, it is important to test the latest version of software). Thanks! |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
Minimal example:
In R-4.0 I get:
In R-3.6 things work fine.
(I'm working on a computer that is not connected to the internet, so I can't check the development version of knitr.)
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my R packages to their latest versions. I do not currently have access to newer RStudio and the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: