我用的utf-8 国内数据库都没有问题,迁移到国外就都变成乱码 sql_latin1_general_cp1_ci_as 那个数据库的字符集  导入他的数据库后查看都是正常的,就是显示出错,重新向数据库里面提交的内容都变成了 ????  导入的数据和刚提交的数据表现形式又不相同.

解决方案 »

  1.   

    提交的内容的内容用Unicode,即nvarchar,nchar,ntext等等类型
    如:
    declare @t table(note nvarchar(20))
    Insert into @t(note)
    select N'内容'
      

  2.   

    好像不是nvarchar  nvarchar  的好像没事这是为什么
      

  3.   

    utf 要用 nvarchar 存才會是utf -8 不然就用其他編碼的
      

  4.   

    你提交的时候编码是什么?比如在网页上提交,那么必须写 charset='unicode'或者utf-8
      

  5.   

    提交时候都有阿。
    提交页面中....<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">收集提交数据页面也要由上面的文字?
      

  6.   

    数据库连接文件中加入了
    <%CODEPAGE="65001"%>
    <%
    Session.CodePage=65001%>
      

  7.   

    有沒有<%@language=vbscript codepage=936 %> 等啊
      

  8.   

    asp ? 问的是这个<%@ Language=VBScript %>
    <!-- #include virtual = "/admin/include/check.asp" -->
    <!-- #include virtual = "/include/conn.asp" -->
    <!-- #include virtual = "/include/const.asp" -->
    <%   
       title          = replace(request("title"),"'","''")
       country        = replace(request("country"),"'","''")
       province       = request("province")
       city           = request("city")
       content        = replace(request("content"),"'","''")
       news_type_id   = request("type_id")
       parent_id      = request("news_type_id")
       news_id        = request("news_id")   
       state          = request("state")
       introduce      = request("introduce")
       if state = "" or isnull(state) then state=0
       is_index       = request("is_index")
       if is_index = "" or isnull(is_index) then is_index=0
       If news_id <> "" Then
       conn.execute("UPDATE news SET title = '" & title & "',content = '" & content  & "',news_type_id = '" & news_type_id  & "',state = '" & state  & "',is_index = '" & is_index  & "',introduce = '" & introduce  & "' WHERE (news_id =" & news_id & ")")   
       Else 
           insertSql="INSERT INTO news (title,content,news_type_id,is_index,state,introduce) VALUES ('" & title & "', '" &content& "', " &news_type_id& ", '" &is_index& "', '" &state& "', '" &introduce& "')"   ' response.write insertSql
           conn.execute(insertSql)         
       End If    Response.Redirect "news_info.asp?news_type_id="&news_type_id&"&parent_id="&parent_id
       Response.End 
    %>
      

  9.   


    codepage=936  去了先   conn.execute("UPDATE news SET title = '" & title & "',content = '" & content  & "',news_type_id = '" & news_type_id  & "',state = '" & state  & "',is_index = '" & is_index  & "',introduce = '" & introduce  & "' WHERE (news_id =" & news_id & ")")
    中 '" & title & "' 前加個N如  WangZWang(先来)  說的
    提交的内容的内容用Unicode,即nvarchar,nchar,ntext等等类型
    如:
    declare @t table(note nvarchar(20))
    Insert into @t(note)
    select N'内容'
      

  10.   

    <%CODEPAGE="65001"%>
    <%
    Session.CodePage=65001
    '----------------------------------------------------------------
    '连接数据库
       Set conn = Server.CreateObject("ADODB.Connection")
     '   conn.Open "PROVIDER=SQLOLEDB;Server=127.0.0.1;DATABASE=aa;UID=sa;PWD=sasa"%>936 ?
      

  11.   

    不在字符串中不用N'字符' sql頁面編碼來
      

  12.   

    conn.execute("UPDATE news SET title = N'" & title & "',content = N'" & content  & "',news_type_id = N'" & news_type_id  & "',state =N '" & state  & "',is_index = N'" & is_index  & "',introduce = N'" & introduce  & "' WHERE (news_id =" & news_id & ")")
      

  13.   

    现在的问题是显示正常(导入的数据),提交新的数据出错.
     建表 用的是 COLLATE Chinese_PRC_CI_AS原数据库好像是  sql_latin1_general_cp1_ci_as
      

  14.   

    如果客戶端的程序和數據庫使用的編碼不同,要用unicode時必須使用N'内容',不然SQL以非unicode編碼傳道數據庫