unicode conversion and export in R

后端 未结 1 1034
太阳男子
太阳男子 2021-01-13 08:33

I have created a script below for converting unicode into chinese characters, the last string in temp.df[,\"name_unicode\"] is \"§®£\" (without quote), so that

相关标签:
1条回答
  • 2021-01-13 08:59

    Using a binary writing will work for your case. The following is a small sample code to do.

    writeUtf8csv <- function(x, file) {
      con <- file(file, "wb")
      apply(x, 1, function(a) {
          b <- paste(paste(a, collapse=','), '\r\n', sep='')
          writeBin(charToRaw(b), con, endian="little")
        })
      close(con)
    }
    

    More details are shown in this reference page.

    0 讨论(0)
提交回复
热议问题