本帖最后由 bcrun 于 2010-08-06 20:16:00 编辑

解决方案 »

  1.   

    本帖最后由 bcrun 于 2010-08-06 20:15:23 编辑
      

  2.   

    sfconfig5.sys是用什么字符集存储的?
      

  3.   

    sfconfig5.sys  用utf-8存的。。
      

  4.   

    好像FileSystemObject不支持UTF8哦,用"FileSystemObject utf8"百度了一下,这个帖子里提到了可用ADODB.Stream操作,按说本版应也可搜索到不少UTF8处理的帖子的:)
    http://blog.sina.com.cn/s/blog_5cd9ecad0100bxom.html
    ASP生成文件格式为UTF-8的XML
      

  5.   

    读出来后转换下好了dim b() as byte
    b= Trim(ipstreamsys.ReadLine)
    str = Utf8ToUnicode2(b,ubound(b))
    Public Function Utf8ToUnicode(ByRef bStr() As Byte, ByVal nSize As Long) As String    Utf8ToUnicode = ""    Dim i As Long
        Dim bLen As Long
        Dim sTemp As String
        Dim lTemp As Long
        Dim lUnicode As Single    bLen = 0
        sTemp = ""
        For i = 0 To nSize - 1        If (bStr(i) And &H80) = &H0 Then
                '0xxxxxxx
                sTemp = sTemp & Chr(bStr(i))
            End If        If (bStr(i) And &HE0) = &HC0 Then
                '110x xxxx   10xx xxxx
                If i + 1 < nSize Then                lUnicode = (bStr(i) And &H1F) * 64 + (bStr(i + 1) And &H3F)
                    sTemp = sTemp & ChrW(lUnicode)
                    i = i + 1            End If
            End If        If (bStr(i) And &HF0) = &HE0 Then
                '1110 xxxx 10xx xxxx 10xx xxxx
                If i + 2 < nSize Then
                    lTemp = (bStr(i) And &HF)
                    lUnicode = lTemp * 4096
                    lUnicode = lUnicode + (bStr(i + 1) And &H3F) * 64 + (bStr(i + 2) And &H3F)
                    sTemp = sTemp & ChrW(lUnicode)
                    i = i + 2
                End If
            End If    Next i    Utf8ToUnicode = sTemp
    End Function
      

  6.   

    本帖最后由 bcrun 于 2010-08-08 09:32:05 编辑