Question : ASP page displays question marks  instead of chinese characters from a MySQL database

Hi,
When I try to display a string containing Chinese characters from a MySQL database, question marks are displayed instead of the Chinese characters.

***Please note I am using ASP and MySQL 5.0.

The field in the database with the Chinese characters has the following settings
Type = varchar(2000)
Collation = utf8_unicode_ci

My code is attached

Thank you so much  in advance,

Drew

Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
<%
 
Dim connectstr
Dim oConn
Dim oRS
 
Response.CodePage = 950
Response.CharSet = "utf8"
 
 
connectstr = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=ABC.net; DATABASE=ABC; UID=ABC;PASSWORD=ABC;charset=utf8" 
 
%>

 



 
Ivey Survey


 

 

 

 

 

<% Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open connectstr qry = "SELECT * FROM QS2Questions WHERE Section ='1'" Set oRS = oConn.Execute(qry) if not oRS.EOF then while not oRS.EOF %> <% oRS.movenext wend oRS.close end if Set oRs = nothing Set oConn = nothing %>

 <%=oRS("Question")%>

 

 

 

Open in New Window Select All

Answer : ASP page displays question marks  instead of chinese characters from a MySQL database

Chinese AFAIK can't be contained as UTF8 - try setting the charset to UTF-16. Also, I'm not sure what means - try removing it.

Stilgar.
Random Solutions  
 
programming4us programming4us