This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / SQL Server 2005 里的中文数据到了ASP页面怎么就成一串串问号了?有行家知道吗?十万火急哦...谢谢!
-phoenixnewlife(NewChapter);
2009-11-16
(#5684473@0)
-
You need nvarchar, nchar, or ntext in SQL server
-whereismyid(到处找ID);
2009-11-16
(#5684545@0)
-
我在一个Table里试了几个Columns,没用。
-phoenixnewlife(NewChapter);
2009-11-16
(#5684670@0)
-
Then you need to adjust your stored proc parameters with nvarchar(100) for the particular colALTER PROCEDURE [dbo].[up_TEST_InsertROLIA]
@FirstName nvarchar(50), --中文COL
@LastName nvarchar(50),--中文COL
@Company nvarchar(100)--中文COL
As
SET NOCOUNT ON
....
Return 0
-whereismyid(到处找ID);
2009-11-16
{196}
(#5684752@0)
-
是创建数据库时字符集用错了吧, 改成支持中文的collation.
-walkthrough(discover);
2009-11-16
(#5684634@0)
-
collation 是中文
-phoenixnewlife(NewChapter);
2009-11-16
(#5684674@0)
-
Can you read the Chinese directly on SQL server?
-hkchan(0);
2009-11-16
(#5684654@0)
-
if you did, the check the setting of "charset" in your ASP.
-hkchan(0);
2009-11-16
(#5684658@0)
-
details pls....or simple samples.
-phoenixnewlife(NewChapter);
2009-11-16
(#5684672@0)
-
再说详细点:中文数据在Management Studio, Open Table, query 都没问题,ASP里hard code的汉字也能显示,就是数据库里的中文数据到了页面就变了...
-phoenixnewlife(NewChapter);
2009-11-16
(#5684668@0)
-
Have you checked the setting of charset?
-hkchan(0);
2009-11-16
(#5684671@0)
-
Now I realize you are using classic ASP. So, check the following:Response.Codepage = 65001
Response.CharSet = "UTF-8"
-whereismyid(到处找ID);
2009-11-16
{55}
(#5684783@0)
-
我已成功显示中文在CLASSIC ASP "SELECT..."<%@CodePage=65001 Language=VBScript %>
<%response.Charset = "utf-8"%>
....
<%
Set RS = server.CreateObject ("ADODB.Recordset")
set dbConnection = server.CreateObject ("ADODB.Connection")
dbConnection.Open Application("DB_ConnectionString")
strSQL = "SELECT * FROM .....
....
RS("Description") 是中文
%>
-whereismyid(到处找ID);
2009-11-17
{347}
(#5685953@0)
-
显示为???????100????? - 17CM?23.5CM - 2009-08 TestChinese 测试中文
Code 见内...
-phoenixnewlife(NewChapter);
2009-11-17
{586}
(#5686205@0)
-
朋友, PLS CHANGE YOUR SETTING TO <%@CodePage=65001 Language=VBScript %>
<%response.Charset = "utf-8"%>
-whereismyid(到处找ID);
2009-11-17
(#5686277@0)
-
我的code 的最前两行就是<%@CodePage=65001 Language=VBScript %>
<%response.Charset = "UTF-8"%>,只不过没有放到前一个帖子里。。。就是不工作哦...
-phoenixnewlife(NewChapter);
2009-11-17
(#5686294@0)
-
PLS COPY/PASTE INSIDE
-whereismyid(到处找ID);
2009-11-17
{638}
(#5686313@0)
-
我的CODE能显DATABASE的中文. 但是如果你又HARDCODE中文在ASP中, 这过就有点麻烦. 你的CODE咋过这么花骚呐?
-whereismyid(到处找ID);
2009-11-17
(#5686359@0)
-
进展:数据库里取出的中文显示了,刚才没看见是因为IE的Encoding设为简体中文,若改成UTF-8就看到了。BUT:ASP里hard coding的中文就看不到了,比如“测试中文”几个字都变��。请问如何二者兼得?谢谢!
-phoenixnewlife(NewChapter);
2009-11-17
(#5686368@0)
-
咋过这么花骚呐?
-whereismyid(到处找ID);
2009-11-17
(#5686372@0)
-
:) 有解吗?
-phoenixnewlife(NewChapter);
2009-11-17
(#5686419@0)
-
我也不想啊...拿来的现成code而已。。。没辙了?
-phoenixnewlife(NewChapter);
2009-11-17
(#5686430@0)
-
用XML 或DATABASE 来对应了. 不过要麻烦一点. 好多这种PAGES?
-whereismyid(到处找ID);
2009-11-17
(#5686486@0)
-
XML是个好主意。
-phoenixnewlife(NewChapter);
2009-11-17
(#5686535@0)
-
非常感谢!
-phoenixnewlife(NewChapter);
2009-11-17
(#5686792@0)
-
先看看具体存在数据库里的数据是不是正常的中文。如果在数据库里就不对,那就是那就是这个数据库,或者这张表,或者这个字段的字符集不对。如果数据库里的内容是正常的,那就是网页的字符集不对。
-yangapple(yangapple);
2009-11-16
(#5684994@0)
-
请问怎么查数据库里的数据是不是正常的中文?“正常”是怎么定义的?
-phoenixnewlife(NewChapter);
2009-11-16
(#5685318@0)
-
写个sql一句话看看直接从数据库里拿出来的东西是不是正常的中文。select 字段名from 表名 where id = xxx
-yangapple(yangapple);
2009-11-16
(#5685378@0)
-
从Mgmt Studio's New Query run SQL select 都没问题,可在ASP里Set ArtRs = Conn.Execute("Select field1...") 然后用<%=Artrs("field1")%>显示数据就成?了。这算“正常”吗?
-phoenixnewlife(NewChapter);
2009-11-16
(#5685463@0)
-
Can you please post your asp here? or search the whole asp and look for "charset" and tell me what its setting is.
-hkchan(0);
2009-11-16
(#5685578@0)
-
你需要做一次字符集转换。在Java中是这么用的。
try {
content = new String(content.getBytes("GB2312"), "utf8");
} catch (UnsupportedEncodingException e) {
try {
content = new String(content.getBytes("GB2312"), "utf-8");
} catch (UnsupportedEncodingException e1) {
}
}
-billdxy(who's the next);
2009-11-17
{264}
(#5686444@0)