VBS 将UI获取的乱码转换成GB2312格式的中文

Str is the source 

Str2 is the target


Str = "Öк½¼ÎÐÅÉÌÎñÂÃÐйÜÀíÓÐÏÞ¹«Ë¾"

Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("c:\testfile.txt", True,TRUE)
MyFile.WriteLine(Str)
MyFile.Close
Set MyFile = nothing
Set fso = nothing
Set stm = CreateObject("Adodb.Stream") 
stm.Type = 2 
stm.mode = 3 
stm.charset = "GB2312" 
stm.Open 
stm.loadfromfile "c:\testfile.txt"
Str2 = stm.readtext 
stm.Close 
Set stm = Nothing 



你可能感兴趣的:(乱码,vbs,vbs,GB32)