-
Notifications
You must be signed in to change notification settings - Fork 338
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 chars in Yaml header rendered wrong #450
Comments
Hello, +1 for the repair, please. |
Are you not able to use the latest version of slidify which is compatible with the new stringr? |
The latest version of slidify with the new stringr works, but the title page has incorrectly rendered international characters, so I have to manually edit the .html file. I have to do this because my name contains international characters :-) There is only a problem with the title page, it looks like it does not get UTF-8 encoding from the YAML section, instead of this, it translate it as a simple ANSI encoding. Following pages work perfectly. |
So did the title page work correctly with international characters previously? I am trying to figure out if this is a regression in |
Yes, it worked perfectly with the previous version. See comparison of two versions with sessionInfo() The problem is with the newest version ("Teorie signálů" renders "Teorie signálĹŻ" and "Tomáš Bořil" renders "Tomáš BoĹ™il" sessionInfo()
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Czech_Czech Republic.1250 LC_CTYPE=Czech_Czech Republic.1250 LC_MONETARY=Czech_Czech Republic.1250 LC_NUMERIC=C
[5] LC_TIME=Czech_Czech Republic.1250
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] slidify_0.5
loaded via a namespace (and not attached):
[1] magrittr_1.5 markdown_0.7.7 tools_3.2.2 whisker_0.3-2 yaml_2.1.13 stringi_1.0-1 knitr_1.11 stringr_1.0.0 The previous version renders everything ok. > sessionInfo()
R version 3.1.3 (2015-03-09)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Czech_Czech Republic.1250 LC_CTYPE=Czech_Czech Republic.1250 LC_MONETARY=Czech_Czech Republic.1250 LC_NUMERIC=C
[5] LC_TIME=Czech_Czech Republic.1250
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] slidify_0.4.5
loaded via a namespace (and not attached):
[1] knitr_1.10.5 markdown_0.7.7 stringr_0.6.2 tools_3.1.3 whisker_0.3-2 yaml_2.1.13 |
Are you running slidify from the R console, or using the knit button inside of RStudio? |
From R console. library(slidify)
slidify("index.Rmd") But it is the same with the 'Knit HTML' button. The YAML is as follows: ---
title : Teorie signálů
subtitle :
author : Tomáš Bořil
job :
framework : io2012 # {io2012, html5slides, shower, dzslides, ...}
highlighter : highlight.js # {highlight.js, prettify, highlight}
hitheme : tomorrow #
widgets : [] # {mathjax, quiz, bootstrap}
mode : selfcontained # {standalone, draft}
knit : slidify::knit2slides
--- |
Weird, it seems to work correctly for me. Here is my
|
Well, could it be a problem of the locale? You have 'UTF-8', I have 1250 (which is 8 bit CP1250). Sys.setlocale("LC_ALL", 'en_US.UTF8')
Warning message:
In Sys.setlocale("LC_ALL", "en_US.UTF8") :
OS reports request to set locale to "en_US.UTF8" cannot be honored |
It must be the problem with the locale encoding. I have converted the source file to CP1250 encoding and the title page works! But the following pages are distorted (because they expect UTF-8 and they get CP1250). |
I have the same issue with the german locale... |
Let me update the |
My locale is: "LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252" I did the following experiment:
Outcome: The title page shows german correctly, the slide - not. When I changed a charset from UTF-8 to latin1 in the index.html the results were the opposite: The title didn't show correctly, the Slide did. In the second experiment I saved the Rmd page in UTF-8 |
I have the same experience with Spanish characters (á,é,í,ó,ú, ...). They show all right in all pages except for the title page. My locale locale: |
My title Slide is showing spanish characters correctly. My others slides don't show them correctly. sessionInfo() locale: title : Sesión 02 |
I have found a "solution". I have downloaded sources of old version of slidify (0.4.5) and stringr (0.6.2) and joined them together into one package called slidify 0.4.5-7. And it works! You can download this old version (0.4.5-7) as follows devtools::install_github("bbTomas/slidify")
devtools::install_github("bbTomas/slidifyLibraries") Then, you can use it library(slidify)
slidify("your-file.Rmd") I do not know what is the change in stringr package but the new version 1.0.0 causes the problem with UTF-8 charecters in YAML when using international (not 'en_US.UTF8') locale. Versions used: |
I think #482 suggest a solution: to add missing |
If I write my name in the author: field in the YAML header it gets rendered wrong in the title slide.
If I copy/paste the same text into a slide, its rendered correctly.
From title slide
From a regular slide
The text was updated successfully, but these errors were encountered: