在自定义函数中,有判断语句,判断字符串中是否包含某个中文字符串,跑不通,然后打开自定义函数发现为乱码,该如何解决?
ps.文件已改为UTF-8编码,并Sys.setlocale("LC_ALL","Chinese")
iscope2 <-function(bc){
if(bc$iscope1 =="FOF"){
isscope2FOF(bc)
}else if(bc$iscope1 == "股票"){
isscope2GP(bc)
}else if(bc$iscope1 == "债券"){
isscope2ZQ(bc)
}else if(bc$iscope1 == "混合"){
isscope2HH(bc)
}else if(bc$iscope1 == "货币"){
isscope2HB(bc)
}else if(bc$iscope1 == "另类"){
isscope2LL(bc)
}else if(bc$iscope1 == "境外"){
isscope2JW(bc)
}
}
function(bc){
if(bc$iscope1 =="FOF"){
isscope2FOF(bc)
}else if(bc$iscope1 == "��Ʊ"){
isscope2GP(bc)
}else if(bc$iscope1 == "ծȯ"){
isscope2ZQ(bc)
}else if(bc$iscope1 == "���"){
isscope2HH(bc)
}else if(bc$iscope1 == "����"){
isscope2HB(bc)
}else if(bc$iscope1 == "����"){
isscope2LL(bc)
}else if(bc$iscope1 == "����"){
isscope2JW(bc)
}
}