r语言编码出现问题,错误如下

  • 这是global.R中引用的代码
    source(file = paste0(COMPONENT_PATH, "/Main/ComfirmedPyramid.ui.R"), local = T, encoding = "UTF-8")

  • 这是出问题的部分
    Component.ComfirmedPyramid <- function() {
    box( title = tagList(icon("venus-mars"), i18n$t("歳代・性別")),
    width = 4, enable_label = T,
    collapsible = T,
    collapsed = T,
    label = boxLabel("Archived", status = "danger"),
    uiOutput("ageGenderOption"),
    echarts4rOutput("genderBar"),
    closable = F,
    footer = tags$small(
    i18n$t("データ提供:"),
    tags$a(icon("database"), "SIGNATE COVID-19 Dataset",
    href = "https://drive.google.com/drive/folders/1EcVW5JQKMB6zoyfHm8_zLVj---t_hccF" ) ) )}

  • 这是错误提示
    Warning in readLines(file, warn = FALSE) :
    invalid input found on input connection '03_Components//Main/ComfirmedPyramid.ui.R'
    Error in source(file = paste0(COMPONENT_PATH, "/Main/ComfirmedPyramid.ui.R"), :
    03_Components//Main/ComfirmedPyramid.ui.R:3:48: unexpected INCOMPLETE_STRING
    2: box(
    3: title = tagList(icon("venus-mars"), i18n$t("歳代

                                                                                  ^