【问题标题】:Change encoding of output html file of r markdown更改 r markdown 的输出 html 文件的编码
【发布时间】:2020-03-27 18:18:22
【问题描述】:

我正在写 文件,我将knit 写入

title: "Analytics"
author: "John Johnson"
date: "`r format(Sys.Date(), '%d %B %Y')`"
output: 
    html_notebook: 
      toc: yes
    html_document: 
      toc: yes
editor_options: 
  chunk_output_type: inline

我在那里使用了一些 UTF-8 编码。我在数据框中有一些俄语的列名,我对其应用了摘要,并希望它在我 knit 之后出现在 html 文件中。但是在我推送knit 之后,它正在被解码并变成这样的混乱:

<U+041B><U+043E><U+043A><U+0430><U+0446><U+0438><U+044F>

我该如何解决?感谢您的回复。

【问题讨论】:

    标签: r-markdown html r encoding r-markdown markdown


    【解决方案1】:

    尝试添加

    Sys.setlocale("LC_CTYPE", "russian")
    

    在设置块中。

    当我在 data.frame 中使用俄语字符编织 .md 时,它可以工作。这直接来自这个帖子:https://www.r-bloggers.com/r-and-foreign-characters/

    【讨论】:

      猜你喜欢
      • 2017-05-05
      • 1970-01-01
      • 1970-01-01
      • 2013-03-01
      • 1970-01-01
      • 2015-05-30
      • 2012-02-25
      • 1970-01-01
      相关资源
      最近更新 更多