我正在使用 vba 进行数据提取项目,在我的代码中,我有包含数据的字符串,并且在生成文本文件期间,我想将整个文本转换为 utf-8 编码字符串。我的代码如下。
Set fso = CreateObject("Scripting.FileSystemObject")
Dim Fileout As Object
Set Fileout = fso.CreateTextFile("C:\Data\colorsizew" & Format(Now(), "_yyyy-mm-dd_hh-mm-ss") "_" & ".txt", True, True)
'Set Fileout = StrConv(Fileout, vbUnicode)
Dim dbs As DAO.Database
Set dbs = CurrentDb
news = asin_map
news = MyClean(news)
'news = MyClean(news)
news = Replace(news, "|", vbLf)
news = Replace(news, "{}", "|")
'news=iconv -c -t utf8 filename.csv > filename.utf8.csv
'---------------------utf-8
'here i want to convert news string in to utf-8
'------------------ends here
Fileout.Write news