txt文本数据导入dw乱码,基本都是字符编码问题,此处给出utf-8转pb编码的示例代码,至于nvo_string对象,可找我要或自行度娘或者csdn下载链接:nvo_string.sru-医疗文档类资源-CSDN下载
string ls_filterpath,ls_temp,ls_writepath
long li_filenum,ll_writenum,ll_sign=1
blob lb_temp
nvo_string lnv_str
ls_filterpath = GetCurrentDirectory()+"\"+as_folder+"\"+as_filename
//ls_writepath = GetCurrentDirectory()+"\"+as_folder+"\temp.txt"
li_filenum = FileOpen(ls_filterpath, LineMode!)
if li_filenum >0 then
do while FileRead(li_filenum, ls_temp) >0
ls_temp = lnv_str.of_utf8_asni(blob(ls_temp))
//FileWrite(ll_writenum,ls_temp)
ls_temp =uf_delquestion(ls_temp)
adw_dw.ImportString(ls_temp)
LOOP
end if
FileClose(li_filenum)
//FileClose(ll_writenum)
//adw_dw.importfile(ls_filterpath)
return true