如:
Private testResp As ASPTypeLibrary.Response
Sub GetData()
      testResp.Write "test?"   '包含瑞典字符
End Sub将工程编译成com组件TestCom,在Component Services中注册成功。在Asp中调用该Sub,得到的是"test?455", 瑞典字符变成乱码。操作为系统英文版,地区、语言和IE里都已设成Swedish, 我在IE里测试Alert('?sdf'); 显示正常。Asp调用代码
set object = Server.CreateObject("TestCom")
str = Eval("object.GetData")
Response.Write str

解决方案 »

  1.   

    补充:Private testResp As ASPTypeLibrary.Response 
    Sub GetData() 
          testResp.Write "testÄ"  '包含瑞典字符 
    End Sub 我在IE里测试Alert('Äsdf'); 显示正常。
      

  2.   

    会不会是Com组件里需要设置编码
      

  3.   

    Private testResp As ASPTypeLibrary.Response
    '设置编码应该就可以了
    Sub GetData()
       testResp.Charset = "GB2312" '选择可以显示瑞典字符的编码
       testResp.CodePage = 936  '936也是中文
       testResp.Write "test?"  '包含瑞典字符 
    End Sub 
      

  4.   

    To:楼上不是response的问题
    是XmlHttp对象的问题, 也就是说如果不通过XmlHttp获取数据的话就没有乱码
    请查看另一个帖子
    http://topic.csdn.net/u/20080730/20/4a655d5f-6553-4fdd-b43e-e23453e13edd.html