久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

stringr-----str_conv

 勤勞的bee 2021-02-01

主頁:https://cran./web/packages/stringr/index.html

#安裝stringr包> install.packages('stringr') > library(stringr)

#stringr函數分類:

    字符串拼接函數

    字符串計算函數

    字符串匹配函數

    字符串變換函數

    參數控制函數

#stringr字符串變換函數

str_conv(string, encoding)

string: 字符串,字符串向量,。 encoding: 編碼名,。

對中文進行轉碼處理。

# 把中文字符字節(jié)化 > x <- charToRaw('你好');x [1] c4 e3 ba c3 # 默認win系統(tǒng)字符集為GBK,,GB2312為GBK字集,,轉碼正常 > str_conv(x, "GBK") [1] "你好" > str_conv(x, "GB2312") [1] "你好" # 轉UTF-8失敗 > str_conv(x, "UTF-8") [1] "???" Warning messages: 1: In stri_conv(string, encoding, "UTF-8") : input data \xffffffc4 in current source encoding could not be converted to Unicode 2: In stri_conv(string, encoding, "UTF-8") : input data \xffffffe3\xffffffba in current source encoding could not be converted to Unicode 3: In stri_conv(string, encoding, "UTF-8") : input data \xffffffc3 in current source encoding could not be converted to Unicodeunicode轉UTF-8 > x1 <- "\u5317\u4eac" > str_conv(x1, "UTF-8") [1] "北京"

    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多