【发布时间】:2020-12-21 02:37:48
【问题描述】:
我正在写一本书,在 Rstudio 中使用 bookdown 以 git_book 格式呈现,但在更改为 bs4_book 格式后,所有拉丁字符甚至英文撇号都不再正确呈现(参见下图)。您可以在this page 和存储库here 中查看当前的实时版本。
我在Github中基于this issue安装了这个版本的bookdown,remotes::install_github("rstudio/bookdown#1027"),还像这样安装了bslib,remotes::install_github("rstudio/bslib")
当我在bs4_book 中渲染这本书时,我收到了以下我以前使用 git_book 没有得到的消息,
#> Tweaking docs/index.html
#> Tweaking docs/intro.html
#> Tweaking docs/folder-strcutures.html
#> Tweaking docs/collaboration-in-git.html
#> Tweaking docs/stata-github.html
#> Tweaking docs/intro-povcal.html
#> Tweaking docs/prepare.html
#> Tweaking docs/lis-data.html
#> Tweaking docs/primus.html
#> Warning messages:
#> 1: In parse(text = text, keep.source = TRUE, encoding = "UTF-8") :
#> integer literal 02.L contains unnecessary decimal point
#> 2: In parse(text = text, keep.source = TRUE, encoding = "UTF-8") :
#> integer literal 00.L contains unnecessary decimal point
#> 3: In parse(text = text, keep.source = TRUE, encoding = "UTF-8") :
#> integer literal 02.L contains unnecessary decimal point
#> 4: In parse(text = text, keep.source = TRUE, encoding = "UTF-8") :
#> integer literal 02.L contains unnecessary decimal point
#> 5: In parse(text = text, keep.source = TRUE, encoding = "UTF-8") :
#> integer literal 00.L contains unnecessary decimal point
#> 6: In parse(text = text, keep.source = TRUE, encoding = "UTF-8") :
#> integer literal 03.L contains unnecessary decimal point
你可以在下面看到我的会话信息,
非常感谢您的帮助。最好的,
sessioninfo::platform_info()
#> setting value
#> version R version 4.0.2 (2020-06-22)
#> os Windows 10 x64
#> system x86_64, mingw32
#> ui RTerm
#> language (EN)
#> collate English_United States.1252
#> ctype English_United States.1252
#> tz America/New_York
#> date 2020-12-20
Sys.getlocale()
#> [1] "LC_COLLATE=English_United States.1252;LC_CTYPE=English_United States.1252;LC_MONETARY=English_United States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252"
stringi::stri_locale_info()
#> $Language
#> [1] "en"
#>
#> $Country
#> [1] "US"
#>
#> $Variant
#> [1] ""
#>
#> $Name
#> [1] "en_US"
【问题讨论】:
-
看起来像双重mojibake。例如,
Andrés Castañeda是1252UTF-8 编码Andrés Castañeda的外观。我不清楚有关整数文字的警告。请edit您的问题提供minimal reproducible example。
标签: r utf-8 r-markdown bookdown