相关疑难解决方法(0)

使用Notepad ++更改保存文件的默认编码

而已 .我想一次打开所有文件(进行替换).但是notepad ++在ANSI中打开它们,我必须遍历每个文件并将编码更改为UTF-8.

encoding notepad++

58
推荐指数
2
解决办法
8万
查看次数

读外国人物

我有一个数据库,其中包含我正在阅读R(3.02)的英超足球运动员的名字,但是当涉及到名字中包含外国角色的球员(变音符号,口音等)时遇到了困难.下面的代码说明了这一点:

PlayerData<-read.table("C:\\Users\\Documents\\Players.csv",quote=NULL, dec = ".",,sep=",", stringsAsFactors=F,header=T,fill=T,blank.lines.skip = TRUE)
Test<-PlayerData[c(33655:33656),] #names of the players here are "Cazorla" "Özil"

Test[Test$Player=="Cazorla",] #Outputs correct details
Test[Test$Player=="Ozil",] # Can not find data '0 rows> (or 0-length row.names)'
<

#Example of how the foreign character is treated:
substr("Özil",1,1)
[1] "Ã"
substr("Özil",1,2)
[1] "Ö"
substr("Özil",2,2)
[1] "
substr("Özil",2,3)
[1] "z
Run Code Online (Sandbox Code Playgroud)

我已经尝试更换字符,如下所述:R:替换字符串中的外来字符,但由于我的示例中的重音字符似乎被读作两个单独的字符,我认为它不起作用.

我会很感激任何建议或解决方法.

该文件可在此处下载.

string encoding r character-encoding string-comparison

6
推荐指数
1
解决办法
517
查看次数