-
Notifications
You must be signed in to change notification settings - Fork 57
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
UTF-8 throws an error when used in the first figure #436
Comments
I can reproduce the error by copying the example code above only if Are you on Windows Perhaps ? If so this is the kind of issue that should be resolved also in next R version when Windows R will use UTF-8 encoding by default. BTW, I edited your post - See this guide on how to correctly format for next time https://yihui.org/issue/#please-format-your-issue-correctly |
Can you try the PR to see if it solves the issue on your end ? remotes::install_github("rstudio/distill#437") Thanks! |
Great, that did the trick! |
Thanks for the confirmation. The fix is now merged in the dev version of distill |
@cderv Thanks for your help. I am also having this problem. It didn't fix it after installing the dev version of distil. DO you sggest removing the self_contained: false part of the code? Will that solve it? It is not also working for rendering the figures that were produced after knitting my codes into distil article. It shows a huge chunks of UTF-8 ... invalid byte sequence in UTF-8 error. |
@Mihiretukebede can you reopen an issue with an example ? I fixed this issue based on the example provided here. Maybe some further fixes are still needed and were missed. I need a reproducible example to investigate. Can you help me fix this for you ? Thanks |
Hmm, basically the failer is caused by the figure files created after knitting into distil article. It creates new folder for files associated with the distil html file. Within that folder, it creates 12 folders and one is named "figure-html5" and it saves all the plots under this folder as file names "unnamed-chunk-1", "unnamed-chunk-2", etc. These unnamed chunk plot PNG files are the main cause. These files are plots created using ggplot2. |
Error message you get is the exact same as this issue ? Can you share a Rmd file throwing the error that I can render on my side maybe ? |
After knitting that rmd file and pushing the changes, the build page fails with the following error (only for this one but I have a hge chunk of such error for other files).
|
After playing around a bit it seems like distill/markdown throws an error when the first figure includes e.g. Æ, Ø, Å. In the code sample below it throws an error every time the first chunk that produces a figure output also includes æ,ø, å in the fig.cap-argument.
The error message I get is:
Error in substring(u, so, so + ml - 1L) :
invalid multibyte string, element 1
Calls: ... regmatches -> Map -> mapply -> -> substring
In addition: Warning messages:
1: In grepl("data-distill-preview=", line, fixed = TRUE) :
input string 1 is invalid UTF-8
2: In grepl("data-distill-preview=", line, fixed = TRUE) :
input string 1 is invalid UTF-8
Execution halted
But if you produce one figure with a fig.cap without these, you can use æ,ø, in subsequent figure captions without errors.
The text was updated successfully, but these errors were encountered: